1

I hava a question about Netty channel.

I inserted a channel handler into a channel pipeline. When connection is down (for example, the peer socket closed), channelInactive method is called:

@Override
public void channelInactive(ChannelHandlerContext ctx) {

}

Do I need to explicitly close the channel in channelInactive method? like:

@Override
public void channelInactive(ChannelHandlerContext ctx) {
    ctx.channel().close();
}

Does Netty do some cleanup for me? Or I have to do some cleanup myself?

ruanhao
  • 4,663
  • 6
  • 28
  • 43

0 Answers0