java chat system over multiple computers

I am running my chat system (developed in java) on one computer, where I am having the server running and multiple clients connecting to it through (localhost, some port number).

It works perfectly, but now when i try to run one of the clients on another PC that is connected to the same WiFi network (router), it does not work. I tried to change the localhost into the ip address 192.168.... and keep the same port, but it does not work. Do you have any suggestions on how to solve the problem and what can be wrong, since I do not quite get the path that the computers are following in order to create that socket with ip address and port, when on two computers.

1 answer

  • answered 2017-06-17 18:45 Mayank Sharma

    check your firewall setting, it may be block connection, so turn off firewall from setting and run project again. on same computer using localhost firewall not block the packet and connection but when connection requested by another computer and receive packet from another computer can be block and also check port is free from firewall. and also check the connections.