@Override public boolean isConnectionOpen() { return channel.isOpen(); }
@Override public void channelUnregistered(ChannelHandlerContext ctx) throws Exception { ctx.fireChannelUnregistered(); // Remove all handlers sequentially if channel is closed and unregistered. if (!channel.isOpen()) { destroy(); } }
protected abstract void run(ChannelHandlerContext ctx); }
if (!allowChannelOpen && channel.isOpen()) { throw new IllegalStateException("close() must be invoked after the channel is closed.");