服务端客户端,cmd通道读写超时处理调整.

This commit is contained in:
aoshiguchen
2023-06-30 18:06:03 +08:00
parent f423056361
commit c20a6db44a
2 changed files with 4 additions and 3 deletions
@@ -61,14 +61,14 @@ public class CmdChannelHandler extends SimpleChannelInboundHandler<ProxyMessage>
switch (event.state()) {
case READER_IDLE:
// 读超时,断开连接
// log.info("读超时");
// ctx.channel().close();
log.error("Client CmdChannel 读超时,断开连接");
ctx.channel().close();
break;
case WRITER_IDLE:
ctx.channel().writeAndFlush(ProxyMessage.buildHeartbeatMessage());
break;
case ALL_IDLE:
log.info("Client CmdChannel 读写超时");
log.error("Client CmdChannel 读写超时,断开连接");
ctx.close();
break;
}
@@ -131,6 +131,7 @@ public class ProxyTunnelChannelHandler extends SimpleChannelInboundHandler<Proxy
ctx.channel().close();
break;
case WRITER_IDLE:
ctx.channel().writeAndFlush(ProxyMessage.buildHeartbeatMessage());
break;
case ALL_IDLE:
break;