[#2033] Correctly handle adding of IdleStateHandler after Channel was already active and registered

This commit is contained in:
Norman Maurer 2013-12-03 13:56:43 +01:00
parent 05c10fae05
commit 7c7acdcaac

View File

@ -207,7 +207,7 @@ public class IdleStateHandler extends ChannelDuplexHandler {
@Override
public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
if (ctx.channel().isActive() & ctx.channel().isRegistered()) {
if (ctx.channel().isActive() && ctx.channel().isRegistered()) {
// channelActvie() event has been fired already, which means this.channelActive() will
// not be invoked. We have to initialize here instead.
initialize(ctx);