title: Meaning of "java.io.IOException: Connection timed out" after connect phase
body: <p>Could be related: <a href="https://stackoverflow.com/questions/17147780/whats-the-difference-between-java-io-ioexception-connection-timed-out-and-s">Difference between Connection timed out and Read timed out</a></p>
  
  <p>I have written a java server application using nio.</p>
  
  <p>I connected a client to my server application and unplugged the network cable of the client. On the server side, I didn't get any exception immediately but after some time (8 minutes or so), I got a "IOException: Connection timed out"</p>
  
  <p>Here is a partial stack trace:</p>
  
  <pre><code>java.io.IOException: Connection timed out
      at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
      at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
      at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:225)
      at sun.nio.ch.IOUtil.read(IOUtil.java:198)
      at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:375)
  ........
  </code></pre>
  
  <p>Till this time, when I saw the netstat output, I see that the socket state of this particular client connection is shown as ESTABLISHED.</p>
  
  <p>Questions are:</p>
  
  <ol>
  <li><p>Is this timeout configurable?</p></li>
  <li><p>Why does the netstat output show the socket state as ESTABLISHED? Ideally it should be CLOSE_WAIT (as the client got disconnected)</p></li>
  </ol>