0
votes

I wrote server and client on Java using Netty.When i run client on my PC it works just fine. When i am trying to run client on other PC it throws me:

java.net.ConnectException: connection timed out
   at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processConnectTimeout(NioClientSocketPipelineSink.java:391)
   at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.run(NioClientSocketPipelineSink.java:289)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
17-Sep-2012 10:58:55 AM org.jboss.netty.channel.SimpleChannelHandler

What is the reason of this?

1

1 Answers

2
votes

Check the connection parameters.

  • Is the server visible from another client? (try pinging the server from the client).
  • Are there any firewalls between? Try switching them off.
  • Check the connection string. Make sure you aren't connecting to localhost.
  • Check the server configuration. Does it listen on the proper network interface.

If you check everything and it seems OK. Post the network connection code here.

Happy coding :)