|
@@ -3,6 +3,7 @@ package com.crossoverjie.cim.client.handle; |
|
@@ -3,6 +3,7 @@ package com.crossoverjie.cim.client.handle; |
|
3
|
import com.crossoverjie.cim.client.util.SpringBeanFactory;
|
3
|
import com.crossoverjie.cim.client.util.SpringBeanFactory;
|
|
4
|
import com.crossoverjie.cim.common.protocol.CIMRequestProto;
|
4
|
import com.crossoverjie.cim.common.protocol.CIMRequestProto;
|
|
5
|
import com.crossoverjie.cim.common.protocol.CIMResponseProto;
|
5
|
import com.crossoverjie.cim.common.protocol.CIMResponseProto;
|
|
|
|
6
|
+import io.netty.channel.ChannelFutureListener;
|
|
6
|
import io.netty.channel.ChannelHandler;
|
7
|
import io.netty.channel.ChannelHandler;
|
|
7
|
import io.netty.channel.ChannelHandlerContext;
|
8
|
import io.netty.channel.ChannelHandlerContext;
|
|
8
|
import io.netty.channel.SimpleChannelInboundHandler;
|
9
|
import io.netty.channel.SimpleChannelInboundHandler;
|
|
@@ -39,7 +40,7 @@ public class CIMClientHandle extends SimpleChannelInboundHandler<CIMResponseProt |
|
@@ -39,7 +40,7 @@ public class CIMClientHandle extends SimpleChannelInboundHandler<CIMResponseProt |
|
39
|
if (idleStateEvent.state() == IdleState.WRITER_IDLE){
|
40
|
if (idleStateEvent.state() == IdleState.WRITER_IDLE){
|
|
40
|
CIMRequestProto.CIMReqProtocol heartBeat = SpringBeanFactory.getBean("heartBeat",
|
41
|
CIMRequestProto.CIMReqProtocol heartBeat = SpringBeanFactory.getBean("heartBeat",
|
|
41
|
CIMRequestProto.CIMReqProtocol.class);
|
42
|
CIMRequestProto.CIMReqProtocol.class);
|
|
42
|
- ctx.writeAndFlush(heartBeat) ;
|
43
|
+ ctx.writeAndFlush(heartBeat).addListeners(ChannelFutureListener.CLOSE_ON_FAILURE) ;
|
|
43
|
}
|
44
|
}
|
|
44
|
|
45
|
|
|
45
|
|
46
|
|