正在显示
1 个修改的文件
包含
1 行增加
和
1 行删除
| @@ -17,7 +17,7 @@ public class HeartbeatInitializer extends ChannelInitializer<Channel> { | @@ -17,7 +17,7 @@ public class HeartbeatInitializer extends ChannelInitializer<Channel> { | ||
| 17 | @Override | 17 | @Override |
| 18 | protected void initChannel(Channel ch) throws Exception { | 18 | protected void initChannel(Channel ch) throws Exception { |
| 19 | ch.pipeline() | 19 | ch.pipeline() |
| 20 | - //五秒没有收到消息 | 20 | + //五秒没有收到消息 将IdleStateHandler 添加到 ChannelPipeline 中 |
| 21 | .addLast(new IdleStateHandler(5, 0, 0)) | 21 | .addLast(new IdleStateHandler(5, 0, 0)) |
| 22 | .addLast(new HeartbeatDecoder()) | 22 | .addLast(new HeartbeatDecoder()) |
| 23 | .addLast(new HeartBeatSimpleHandle()); | 23 | .addLast(new HeartBeatSimpleHandle()); |
-
请 注册 或 登录 后发表评论