ReadTimeoutHandler behavior validation

Shay Banon kimchy at gmail.com
Tue Apr 6 19:01:42 EDT 2010


Sure, make sense. I was just wondering how to best implement an HTTP
keepAlive timeout. Its a bit different than how ReadTimeoutHandler works
now.

Basically, what I want is to close connections when there are no more active
on going connections for X duration. What I am thinking currently is to
combine the Write and Read timeout handlers. Basically, the idea is that I
maintain a counter (volatile is enough) of current on going connection.
Increment the counter with messageReceive, and decrement it when sending
back a response on the same channel. Then, the ReadTimeout logic remains the
same, exception that no exception is raised if the counter is higher than 0.
What do you think?

cheers,
shay.banon

On Tue, Apr 6, 2010 at 12:36 PM, "Trustin Lee (이희승)" <trustin at gmail.com>wrote:

> Hi Shay,
>
> If the client does not send anything within 30 seconds since it sent the
> previous request, ReadTimeoutHandler will raise an exception so that you
> can close the connection.
>
> However, nobody stops the client from sending another request.  It's not
> even protocol violation since HTTP allows pipelining.  In such a case,
> you will not get an exception within 30 seconds.
>
> HTH,
> Trustin
>
> Shay Banon wrote:
> > Hi,
> >
> >   I am using the ReadTimeoutHandler with netty to close HTTP connection
> that
> > opened a keepAlive connection but never properly closed it. I am setting
> it
> > to 30 seconds. I just wanted to validate something regarding
> > the ReadTimeoutHandler. Is it true that if I have a request that takes
> more
> > than 30 seconds to process on the server before sending back a response,
> it
> > will close the connection?
> >
> > Cheers,
> > -shay.banon
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > netty-users mailing list
> > netty-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/netty-users
>
> --
> what we call human nature in actuality is human habit
> http://gleamynode.net/
>
>
>
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20100407/687f0b7c/attachment-0001.html 


More information about the netty-users mailing list