作者 crossoverJie

:art: Improving structure / format of the code.

... ... @@ -88,7 +88,7 @@ public class CIMClientHandle extends SimpleChannelInboundHandler<CIMResponseProt
}
scheduledExecutorService.scheduleAtFixedRate(new HeartBeatJob(ctx),30,30, TimeUnit.SECONDS) ;
scheduledExecutorService.scheduleAtFixedRate(new HeartBeatJob(ctx),60,60, TimeUnit.SECONDS) ;
}
... ...
... ... @@ -25,7 +25,7 @@ public class CIMClientHandleInitializer extends ChannelInitializer<Channel> {
protected void initChannel(Channel ch) throws Exception {
ch.pipeline()
//30 秒没发送消息 将IdleStateHandler 添加到 ChannelPipeline 中
.addLast(new IdleStateHandler(0, 50, 0))
.addLast(new IdleStateHandler(0, 10, 0))
//心跳解码
//.addLast(new HeartbeatEncode())
... ...
... ... @@ -26,7 +26,7 @@ public class CIMServerInitializer extends ChannelInitializer<Channel> {
ch.pipeline()
//30 秒没有向客户端发送消息就发生心跳
.addLast(new IdleStateHandler(30, 0, 0))
.addLast(new IdleStateHandler(10, 0, 0))
// google Protobuf 编解码
.addLast(new ProtobufVarint32FrameDecoder())
.addLast(new ProtobufDecoder(CIMRequestProto.CIMReqProtocol.getDefaultInstance()))
... ...