title: What is the difference between Tomcat's BIO Connector and NIO Connector?
body: <p>I would like to know the internals of the tomcat NIO connector. How exactly are threads used when we create a servlet that implements CometProcessor?Is it still one thread per connection?</p>
  
  <p>From what I read, the conversation goes like this</p>
  
  <ol>
  <li><p>Client connects to a servlet</p></li>
  <li><p>Servlet hangs on to the connection till there is any data available
  to the connected client</p></li>
  <li><p>When data is ready , the server writes to the httpResponse and
  flushes it. This actually disconnects the connection?</p></li>
  <li><p>Client sends another request which the server again hangs onto..</p></li>
  </ol>
  
  <p>How many thread are used when this keeps happening?</p>