* @param flip boolean
* @return int
* @throws IOException
+ * @todo Fix non blocking write properly
*/
private synchronized int writeToSocket(ByteBuffer bytebuffer, boolean flip, boolean block) throws IOException {
//int limit = bytebuffer.position();
}finally {
if ( selector != null ) getSelectorPool().put(selector);
}
- socket.getBufHandler().getWriteBuffer().clear();
+ if ( block ) socket.getBufHandler().getWriteBuffer().clear(); //only clear
this.total = 0;
return written;
}
<subsection name="Comet timeouts">
<p>If you are using the NIO connector, you can set individual timeouts for your different comet connections.
To set a timeout, simple set a request attribute like the following code shows:
- <source>CometEvent event.... event.setTimeout(30*1000);</source>
+ <source>event.setTimeout(30*1000);</source>
<br/>You can set the timeout on the comet connection at any point in time, even asynchronously.
Setting a timeout to 1 (one milliseconds) doesn't guarantee that it will timeout at that time.
Setting the timeout gurantees that Tomcat wont timeout the connection before the connection has been idle