title: How do I check if a Socket is currently connected in Java?
body: <p>I'm trying to find out whether a Java TCP Socket is <em>currently</em> connected, the following just seems to tell me whether the socket has been connected at some point - not whether it is currently still connected.</p>
  
  <pre><code>socket.isConnected();
  </code></pre>
  
  <p>Any help appreciated, thanks.</p>