About SimpleChannelHandler.channelDisconnected

Clement Mathieu clement.mathieu at activeeon.com
Thu Nov 4 06:42:19 EDT 2010


On Wed, 3 Nov 2010 15:44:57 -0700 (PDT)
brunodecarvalho <kindernade at gmail.com> wrote:

Thanks for the enlightening post. I missed the point that when
Channel.close() is called my channelDisconnected method is invoked two
times; once with an upstream event and once with a downstream event. 
My error was to think:
 - Connection lost -> upstream event
 - Channel.close() -> downstream event 

I played a little bit with my handler this morning
and it is now crystal clear that you are 100% right. 

I called it a "hack" (with double quotes) because I believed that Netty
would provide a built-in mechanism/API to handle this use case. Isn't
it possible to improve the API to get rid of the flag ? 

Regards,

Clément MATHIEU.



More information about the netty-users mailing list