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

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;
}
}
@@ -11,7 +11,7 @@ neutrino:
length-adjustment: 0
read-idle-time: 40
write-idle-time: 5
all-idle-time-seconds: 0
all-idle-time-seconds: 45
client:
thread-count: 50
key-store-password: ${STORE_PASS:123456}
@@ -124,7 +124,6 @@ public class ServerChannelHandler extends SimpleChannelInboundHandler<ProxyMessa
ctx.channel().close();
break;
case WRITER_IDLE:
log.info("写超时");
break;
case ALL_IDLE:
break;