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

Daniel Ferber dffforum at gmail.com
Wed Nov 10 10:44:24 EST 2010


After debugging, I noticed that the channelDisconnected() and
channelUnbound() events are never called on the pipeline as shown in the
NioWorker class below.

What could be the reason that the channel is not set as connected nor bound?
(debugger accuses that channel.setClosed()== true; but connected==false and
bound==false).

void NioWorker.close(NioSocketChannel channel, ChannelFuture future) {
        boolean connected = channel.isConnected();
        boolean bound = channel.isBound();
        try {
            channel.socket.close();
            cancelledKeys ++;

            if (channel.setClosed()) {
                future.setSuccess();
                if (connected) {
                    fireChannelDisconnected(channel);
                }
                if (bound) {
                    fireChannelUnbound(channel);
                }

                cleanUpWriteBuffer(channel);
                fireChannelClosed(channel);
            } else {
                future.setSuccess();
            }
        } catch (Throwable t) {
            future.setFailure(t);
            fireExceptionCaught(channel, t);
        }
    }

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


More information about the netty-users mailing list