title: How can a socket be both connected and closed?
body: <p>I'm using a Java socket client. In a case where the server is still connected to my client but it does not send a response to my message - I eventually get a read time out exception.</p>
  
  <p>In that case I want to test to see if I should reconnect my socket or just keep it an re-use it.</p>
  
  <p>I use this condition:</p>
  
  <pre><code>if (!socket.isConnected() || socket.isClosed() || !socket.isBound()) {
      try {
          socket.close();
      } catch (IOException e1) {
      }
      // Wait on a new connection
      socket = connectSocket(.....);
  }
  </code></pre>
  
  <p>But I always seem to reconnect. When I log the values of the Boolean properties I see this: </p>
  
  <p>connected: true closed: true bound: true</p>
  
  <p>How can it be connected and closed?</p>
  
  <p>TIA</p>