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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]