I'm trying to write a simply program client-server program that would connect a Client machine to a Server machine.
My code so far works well on the localhost, but when I replace the ip address in the Client code to the local ip address of the Server machine no connection is done. I think my understanding of InetAddress is off.
Socket connect code: Client.java
InetAddress ip = InetAddress.getByName("my_ip_address");
Socket s = new Socket(ip, 9876); //<- where the connection timeout happens
Socket s = new Socket(ip, 9876);:java.net.ConnectException: Connection timed out: connect