客户端优化,解决长时间数据写入,导致指令通道被关闭的问题

This commit is contained in:
aoshiguchen
2023-04-20 23:04:39 +08:00
parent 2b95967820
commit f2b560fa1f
3 changed files with 5 additions and 4 deletions
@@ -73,13 +73,15 @@ public class ClientChannelHandler extends SimpleChannelInboundHandler<ProxyMessa
switch (event.state()) {
case READER_IDLE:
// 读超时,断开连接
log.info("读超时");
ctx.channel().close();
// log.info("读超时");
// ctx.channel().close();
break;
case WRITER_IDLE:
ctx.channel().writeAndFlush(ProxyMessage.buildHeartbeatMessage());
break;
case ALL_IDLE:
log.info("读写超时");
ctx.channel().close();
break;
}
}