tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik - Dev Lists <devli...@hanik.com>
Subject Re: Comet changes
Date Tue, 08 May 2007 08:46:10 GMT
Remy Maucherat wrote:
> Filip Hanik - Dev Lists wrote:
>> I thought about the canWrite idea earlier, and there is a difficult 
>> problem to get around. the steps are
>> 1. canWrite - returns true
>> 2. response.getOutputStream().write(8k byte array)
>> 3. only 2k gets written during the non blocking write
>>
>> so what does one do? does it issue a blocking write for the 
>> remainder? it gets quite tricky.
>
> That's the easy part: the bytes are kept in the usual socket buffer, 
> which will be flushed when the connection comes back from the write 
> poller, just before invoking the write event.
not so easy, if the servlet invokes write again, you have concurrency 
issues. first you register the socket for a WRITE event with the poller, 
at the same time an async thread tries to write more data.

Filip
>
> Rémy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message