Improving structure / format of the code.
正在显示
3 个修改的文件
包含
3 行增加
和
3 行删除
| @@ -88,7 +88,7 @@ public class CIMClientHandle extends SimpleChannelInboundHandler<CIMResponseProt | @@ -88,7 +88,7 @@ public class CIMClientHandle extends SimpleChannelInboundHandler<CIMResponseProt | ||
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | 90 | ||
| 91 | - scheduledExecutorService.scheduleAtFixedRate(new HeartBeatJob(ctx),30,30, TimeUnit.SECONDS) ; | 91 | + scheduledExecutorService.scheduleAtFixedRate(new HeartBeatJob(ctx),60,60, TimeUnit.SECONDS) ; |
| 92 | 92 | ||
| 93 | } | 93 | } |
| 94 | 94 |
| @@ -25,7 +25,7 @@ public class CIMClientHandleInitializer extends ChannelInitializer<Channel> { | @@ -25,7 +25,7 @@ public class CIMClientHandleInitializer extends ChannelInitializer<Channel> { | ||
| 25 | protected void initChannel(Channel ch) throws Exception { | 25 | protected void initChannel(Channel ch) throws Exception { |
| 26 | ch.pipeline() | 26 | ch.pipeline() |
| 27 | //30 秒没发送消息 将IdleStateHandler 添加到 ChannelPipeline 中 | 27 | //30 秒没发送消息 将IdleStateHandler 添加到 ChannelPipeline 中 |
| 28 | - .addLast(new IdleStateHandler(0, 50, 0)) | 28 | + .addLast(new IdleStateHandler(0, 10, 0)) |
| 29 | 29 | ||
| 30 | //心跳解码 | 30 | //心跳解码 |
| 31 | //.addLast(new HeartbeatEncode()) | 31 | //.addLast(new HeartbeatEncode()) |
| @@ -26,7 +26,7 @@ public class CIMServerInitializer extends ChannelInitializer<Channel> { | @@ -26,7 +26,7 @@ public class CIMServerInitializer extends ChannelInitializer<Channel> { | ||
| 26 | 26 | ||
| 27 | ch.pipeline() | 27 | ch.pipeline() |
| 28 | //30 秒没有向客户端发送消息就发生心跳 | 28 | //30 秒没有向客户端发送消息就发生心跳 |
| 29 | - .addLast(new IdleStateHandler(30, 0, 0)) | 29 | + .addLast(new IdleStateHandler(10, 0, 0)) |
| 30 | // google Protobuf 编解码 | 30 | // google Protobuf 编解码 |
| 31 | .addLast(new ProtobufVarint32FrameDecoder()) | 31 | .addLast(new ProtobufVarint32FrameDecoder()) |
| 32 | .addLast(new ProtobufDecoder(CIMRequestProto.CIMReqProtocol.getDefaultInstance())) | 32 | .addLast(new ProtobufDecoder(CIMRequestProto.CIMReqProtocol.getDefaultInstance())) |
-
请 注册 或 登录 后发表评论