title: Java exception while attempting socket connection
body: <p>I am trying to make a socket connection to an ip:port and it all works correctly on one of my computers. The client first connects to the server with a socket connection to log in; after that it expects incoming connections from the server and they are successful.</p>
  
  <p>But, when I tried it on another computer, the client made the first connection to log in successfuly, and then waited for incoming connections. On the server side where the connections would be initiated I got this message:   </p>
  
  <p><code>java.net.NoRouteToHostException</code> </p>
  
  <p>and the incoming connection failed. </p>
  
  <p>Why would that happen? Could it be a firewall issue?</p>
  
  <pre><code>s = new Socket(id, 4446);
  BufferedWriter out1 = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
  BufferedReader in1 = new BufferedReader(new InputStreamReader(s.getInputStream()));
  </code></pre>
  
  <p>thats the 46-th line</p>
  
  <pre><code>java.net.NoRouteToHostException: No route to host: connect
          at java.net.PlainSocketImpl.socketConnect(Native Method)
          at java.net.PlainSocketImpl.doConnect(Unknown Source)
          at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
          at java.net.PlainSocketImpl.connect(Unknown Source)
          at java.net.SocksSocketImpl.connect(Unknown Source)
          at java.net.Socket.connect(Unknown Source)
          at java.net.Socket.connect(Unknown Source)
          at java.net.Socket.&lt;init&gt;(Unknown Source)
          at java.net.Socket.&lt;init&gt;(Unknown Source)
          at sample_server.doComms.run(doComms.java:46)
          at java.lang.Thread.run(Unknown Source)
  </code></pre>