*TimeOutHandlers

Trustin Lee trustin at gleamynode.net
Wed Feb 11 04:42:48 EST 2009


On Wed, Feb 11, 2009 at 5:12 PM, Christian Migowski
<chrismfwrd at gmail.com> wrote:
> On Wed, Feb 11, 2009 at 6:01 AM, Trustin Lee <trustin at gleamynode.net> wrote:
>> I was able to reproduce the problem Dave and Christian reported and
>> have just checked in the fix.
>>
>> I'm still not sure ChannelReadTimeoutException should be fired only
>> once while a channel is connected.  I think it's just fine to raise
>> the exception periodically, and it's sometimes useful.
>
> Really? Maybe thats where an architectural overview of Netty and its
> design goals would have come in handy, are Netty channels "reusable"?
> I was under the impression that you'll get a "new" channel when the
> client connects again to the server or if you do a new connect() with
> a client.

I'm not sure we are on the same page.  Let me rephrase what I meant to
avoid misunderstanding:

1) ReadTimeoutException should not be raised when a Channel is disconnected.
2) ReadTimeoutException should be raised periodically while a Channel
is connected.

> Could you outline a little bit why a Channel should raise the
> ReadTimeoutException when it predictably will raise that exception
> because there is nothing to read (channel disconnected)? You _can_
> detect a disconnection with channelDisconnected(...), right?

Yes, we can detect a disconnection with a channelDisconnected event
and ReadTimeoutException should not be raised unless a Channel is
connected.

BTW, I have checked in IdlenessHandler which might fulfill your needs,
but it seems like it's not being synchronized to the anonymous SVN
repository at this moment.  Let me paste it for your convenience:

  * IdlenessHandler - http://pastebin.com/m66e1e937
  * IdlenessEvent - http://pastebin.com/m4bc7d5c5
  * DefaultIdlenessEvent - http://pastebin.com/m6ea6b5b

Once the synchronization between the committable repository and the
read-only repository is recovered, they should appear here:

  * http://fisheye.jboss.org/browse/Netty/trunk/src/main/java/org/jboss/netty/handler/timeout

Thanks for the feed back,

— Trustin Lee, http://gleamynode.net/




More information about the netty-users mailing list