An exceptionCaught event was fired,and it ched at the tail of the pipeline,it usually means the last
1.场景先来说说我产生问题的场景,通过netty不停的采集数据,并且通过页面展示出来,发送命令,页面也会有对应的返回结果,而实际的场景是,发送命令后,提示站点不在线,说明session的链接出了问题。2.解决方法:在netty的handle类中增加异常处理方法@Overridepublic void exceptionCaught(Cha...
·
1.场景
先来说说我产生问题的场景,通过netty不停的采集数据,并且通过页面展示出来,发送命令,页面也会有对应的返回结果,而实际的场景是,发送命令后,提示站点不在线,说明session的链接出了问题。
2.解决方法:
在netty的handle类中增加异常处理方法
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
super.exceptionCaught(ctx, cause);
Channel channel = ctx.channel();
if(channel.isActive())ctx.close();
}
更多推荐
所有评论(0)