Going from memory rather than looking at the code that I don't have easy access 
to right now...

Konstantin Kolinko <knst.koli...@gmail.com> wrote:

>Reviewing #breakKeepAliveLoop() method in Http11 implementations in
>7.0.x,
>there is a difference between Nio and Apr:
>
>I see that Http11NioProcessor does not update
>AbstractHttp11Processor#sendfileInProgress flag, but Apr processor
>does set it to "true".
>
>Is this difference in #breakKeepAliveLoop() implementations intended?

Yes.

>JavaDoc says that the sendfileInProgress flag is used to indicate "that
>the
>* socket should not be returned to the poller (where a poller is
>used)."
>and I understand that both of them use pollers.

Both NIO and APR use polling but in different ways. They handle the following 
questions (BIO is different again) differently:
- time out when reading directly from the socket
- time out when in the poller
- use keep alive or not
- when returning from the processor, should the socket be added to the pollers 
(very similar to previous point)

Broadly, APR uses the return value and a few flags on the processor to control 
this whereas NIO uses the socket wrapper to set things directly.

I'm sure there is scope for further refactoring that reduces the differences 
further and removes the need for some of these flags. That is on my todo list 
but WebSockets is next now I have the bulk of the HTTP processing in a common 
base class.

Mark





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

Reply via email to