Comet connection handling. When the response.getWriter().close() method has been called,
the comet connection is setup for closure instead of waiting for a timeout.
This is necessary since the servlet could have set a long timeout.
Also, improve on timeout checking. Only use the optimization for how frequently we need to check the keys if there has been no activity on the selector. During heavy activity, the optimization takes into effect.
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@423544
13f79535-47bb-0310-9956-
ffa450edef68