title: check if a server socket is open on the other side
body: <p>I would check if a server socket placed in the server is open. In the client when I create the socket <code>Socket sock = new Socket(host,port)</code> I check if it's open doing:</p>
  
  <pre><code>if(sock == null)
      System.out.println("The server is not connected!");
  else
      //Doing some task
  </code></pre>
  
  <p>but i don't receive any result. there is method to check if the server socket at on the other side is open? I tried even the method <code>isConnected()</code> but nothing</p>