You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Remy Maucherat <re...@apache.org> on 2008/10/29 00:14:45 UTC

APR and NIO

Hi,

Trying out Bayeux quickly (after all, there's still nothing to test with
Comet wise otherwise), it works with NIO, but not with APR.

What is the fundamental difference ?

Rémy



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


Re: APR and NIO

Posted by Mladen Turk <mt...@apache.org>.
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).

Regards
-- 
^(TM)

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


Re: APR and NIO

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
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

Remy Maucherat wrote:
> On Tue, 2008-10-28 at 18:56 -0600, Filip Hanik - Dev Lists wrote:
>   
>> in trunk there is one difference, NIO allows async CometEvent.close, APR 
>> has the hooks in place, but I haven't dared to dig into the poller code yet.
>>
>> that's the only thing I can think of right now.
>>     
>
> I only wanted to see something running, so nio works. Looking in the
> logs I see the not implemented exception on setTimeout. More mundane
> than an async close or something, I suppose.
>
> 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


Re: APR and NIO

Posted by Remy Maucherat <re...@apache.org>.
On Tue, 2008-10-28 at 18:56 -0600, Filip Hanik - Dev Lists wrote:
> in trunk there is one difference, NIO allows async CometEvent.close, APR 
> has the hooks in place, but I haven't dared to dig into the poller code yet.
> 
> that's the only thing I can think of right now.

I only wanted to see something running, so nio works. Looking in the
logs I see the not implemented exception on setTimeout. More mundane
than an async close or something, I suppose.

Rémy



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


Re: APR and NIO

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
in trunk there is one difference, NIO allows async CometEvent.close, APR 
has the hooks in place, but I haven't dared to dig into the poller code yet.

that's the only thing I can think of right now.

Filip

Remy Maucherat wrote:
> Hi,
>
> Trying out Bayeux quickly (after all, there's still nothing to test with
> Comet wise otherwise), it works with NIO, but not with APR.
>
> What is the fundamental difference ?
>
> 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