Netty IO 检查服务器是否关闭

Netty IO check if Server closed

如何检查客户端的服务器 closed/shut 是否宕机?我想在服务器关闭时通知用户。 有什么方法可以做到吗?

当连接关闭时,您的处理程序将通过 channelInactive() 方法得到通知。