tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <>
Subject Re: APR and NIO
Date Sun, 02 Nov 2008 14:51:38 GMT
Filip Hanik - Dev Lists wrote:
> The async close is important to 'long-polling' which is what bayuex does.
> if you have  20 second timeout, there is a chance that the client could 
> reuse the connection after it has received the 'end chunk' (0) from the 
> server, and sends a new request.
> if there is no async close support, then the server will take the new 
> request and generate a READ event in the old request space.
> that's why I wanted the hooks in there for async-close support
> Filip

Didn't look at the code, but the proper solution
would be to do a lingering close; using shutdownWr
and then read what's left in the queue for some
lingering or shutdown timeout. If the client
don't respect that FIN was send or it was sending
the new request at the moment we send shutdown
the request should be invalid.
IMO once when you say you'll close, everything that's
on the socket should be silently dropped.
You can eventually post the event that would signal
the state of lingering close (weather the client
send FIN or timeout occurred) but in any case no
data should be passed to the client, since you
cannot be sure weather the data was part of current
or new request (remote sync issue).


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message