IdleStateAwareChannelHandler.channelDisconnected(...) is not called intermittently

Daniel Ferber dffforum at gmail.com
Wed Nov 10 08:38:03 EST 2010


I have a ChannelHandler that depends on channelDisconnected() to decide if
the communication is considered 'successful', depending on previous actions
registered by a state machine related to the channel. For example, if
channelDisconnected() is called but client and server did not exchange a
goodbye message, then the communication is considered as 'failure'.

There are some server-side situations that require to disconnect the socket:
 - channelIdle() is called
 - messageReceived() is called with the goodbye message.
Both call Channels.disconnect(ctx.getChannel()) in order to disconnect the
communication.

I have observed that sometimes channelDisconnected() will not be called, and
therefore the ChannelHandler does not decide if the communication was
successful. In such situation, just channelClosed() is called.

I am missing something? Is the channelDisconnected() event optional in the
pipeline or just triggered under certain conditions? Or shall I take another
approach to disconnect instead of Channels.disconnect(ctx.getChannel())? 

Best regards,
Daniel Felix Ferber



-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/IdleStateAwareChannelHandler-channelDisconnected-is-not-called-intermittently-tp5724710p5724710.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list