1、加长TCP空闲周期
This commit is contained in:
parent
7cc12e830d
commit
1639575184
@ -36,7 +36,7 @@ public class RtcmTcpHandler extends SimpleChannelInboundHandler<ByteBuf> {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
@Override
|
@Override
|
||||||
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
|
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
|
||||||
if(evt instanceof IdleStateEvent) {
|
if(evt instanceof IdleStateEvent) {
|
||||||
@ -49,7 +49,7 @@ public class RtcmTcpHandler extends SimpleChannelInboundHandler<ByteBuf> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void channelInactive(ChannelHandlerContext ctx)
|
public void channelInactive(ChannelHandlerContext ctx)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
|
|||||||
@ -40,7 +40,7 @@ public class RtcmTcpServer implements ApplicationRunner {
|
|||||||
@Override
|
@Override
|
||||||
protected void initChannel(Channel channel) throws Exception {
|
protected void initChannel(Channel channel) throws Exception {
|
||||||
ChannelPipeline p = channel.pipeline();
|
ChannelPipeline p = channel.pipeline();
|
||||||
p.addLast(new IdleStateHandler(600, 600, 600)); //设置心跳超时时间,秒
|
//p.addLast(new IdleStateHandler(600, 600, 600)); //设置心跳超时时间,秒
|
||||||
p.addLast(new RtcmTcpHandler());
|
p.addLast(new RtcmTcpHandler());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user