1、加长TCP空闲周期

This commit is contained in:
weidong 2024-04-08 19:35:25 +08:00
parent 7cc12e830d
commit 1639575184
2 changed files with 3 additions and 3 deletions

View File

@ -36,7 +36,7 @@ public class RtcmTcpHandler extends SimpleChannelInboundHandler<ByteBuf> {
}
}
/*
@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
if(evt instanceof IdleStateEvent) {
@ -49,7 +49,7 @@ public class RtcmTcpHandler extends SimpleChannelInboundHandler<ByteBuf> {
}
}
}
*/
@Override
public void channelInactive(ChannelHandlerContext ctx)
throws Exception {

View File

@ -40,7 +40,7 @@ public class RtcmTcpServer implements ApplicationRunner {
@Override
protected void initChannel(Channel channel) throws Exception {
ChannelPipeline p = channel.pipeline();
p.addLast(new IdleStateHandler(600, 600, 600)); //设置心跳超时时间
//p.addLast(new IdleStateHandler(600, 600, 600)); //设置心跳超时时间
p.addLast(new RtcmTcpHandler());
}
});