|
...
|
...
|
@@ -17,7 +17,7 @@ public class CustomerHandleInitializer extends ChannelInitializer<Channel> { |
|
|
|
@Override
|
|
|
|
protected void initChannel(Channel ch) throws Exception {
|
|
|
|
ch.pipeline()
|
|
|
|
//10 秒没发送消息
|
|
|
|
//10 秒没发送消息 将IdleStateHandler 添加到 ChannelPipeline 中
|
|
|
|
.addLast(new IdleStateHandler(0, 10, 0))
|
|
|
|
.addLast(new HeartbeatEncode())
|
|
|
|
.addLast(new EchoClientHandle())
|
...
|
...
|
|