When creating the ServerSocket, make sure you are binding to the same host and port which the client is trying to connect to. Look into the different types of constructors offered by ServerSocket class and use the one which also allows you to specify the IP to bind to.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
> If I bind the server socket, I would bind it to 127.0.0.1
That anyways wouldn't work because in that case it won't be accessible by external clients (given that this is a loopback address).
Your ServerSocket creation looks OK. The problem might be of unreachable host/port due to blocking of communication by your ISP. Go to http://canyouseeme.org/ which shows your IP address and asks you to input the port number of your running application. If after clicking the "check" button you can see an output of the form: "I can see your service on X.X.X.X on port (XXXX)", it means that your service is visible to others. If the test times out, then it is a problem with your firewall/ISP settings.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
Unfortunately, I don't have a Ubuntu installation handy to help you out.
I'd suggest you to either ask your friend to help you out with the firewall configuration (assuming he had tweaked his own) or search around for "ubuntu firewall config" which brings up quite a few articles that might help you pin down the problem.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734