title: How do I prove that Jetty 9 SelectChannelConnector timeouts work?
body: <p>I am using Jetty 9.0.4 with Java 1.7.0 on Windows 7.</p>
  
  <p>How do I prove that these timeouts work? Ideally I am looking for an integration unit test that will fail if they do not work.</p>
  
  <pre><code>org.mortbay.jetty.nio.SelectChannelConnector connector = new SelectChannelConnector();
  connector.setMaxIdleTime(10_000);
  connector.setSoLingerTime(10_000);
  connector.setLowResourceMaxIdleTime(10_000);
  </code></pre>
  
  <p>I tried connecting to the http port in the following way, but it does not fail, just keeps on reading a byte every one minute. I expected it to fail because the max idle time was set to 10 seconds.</p>
  
  <pre><code>Socket socket = new Socket("localhost", port);
  OutputStream outputStream = socket.getOutputStream();
  outputStream.write("GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n".getBytes());
  outputStream.flush();
  InputStream content = socket.getInputStream();
  char aChar;
  int bytesToReceive = 1000;
  while((aChar = (char) content.read()) != -1 &amp;&amp; bytesToReceive-- &gt; 0) {
      System.out.println("Read '" + aChar + "' and going to sleep for a minute.");
      Thread.sleep(60_000);
  }
  </code></pre>