From: fhanik Date: Thu, 7 Jun 2007 13:48:07 +0000 (+0000) Subject: notes, still need some work on the write to socket X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ab13b5c34bdb11d14523bf20990e18018c3c4ba1;p=tomcat7.0 notes, still need some work on the write to socket git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@545180 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/coyote/http11/InternalNioOutputBuffer.java b/java/org/apache/coyote/http11/InternalNioOutputBuffer.java index 70a48925d..df5dc7155 100644 --- a/java/org/apache/coyote/http11/InternalNioOutputBuffer.java +++ b/java/org/apache/coyote/http11/InternalNioOutputBuffer.java @@ -417,6 +417,7 @@ public class InternalNioOutputBuffer * @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(); @@ -440,7 +441,7 @@ public class InternalNioOutputBuffer }finally { if ( selector != null ) getSelectorPool().put(selector); } - socket.getBufHandler().getWriteBuffer().clear(); + if ( block ) socket.getBufHandler().getWriteBuffer().clear(); //only clear this.total = 0; return written; } diff --git a/webapps/docs/aio.xml b/webapps/docs/aio.xml index 520ea91c2..b6143d590 100644 --- a/webapps/docs/aio.xml +++ b/webapps/docs/aio.xml @@ -409,7 +409,7 @@ public class ChatServlet

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: - CometEvent event.... event.setTimeout(30*1000); + event.setTimeout(30*1000);
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