Netty空闲状态(心跳)检测
2021-04-19 10:54:41 1 举报
Netty空闲状态(心跳)检测
作者其他创作
大纲/内容
initialize(ctx)
创建
channelActive
写操作结束
long readerIdleTimeNanos;
io.netty.handler.timeout.IdleStateHandler
……
1s = 1000ms1ms = 1000μs1μs = 1000ns
boolean reading = false;
firstWriterIdleEvent = firstAllIdleEvent = true;
constructor
destroy()
channelRegistered
byte state = 0;
long lastWriteTime = ticksInNanos();
writeListener
handlerAdded
write
读空闲定时任务
long allIdleTimeNanos;
handlerRemoved
boolean firstAllIdleEvent = true;
channelReadComplete
channelInactive
读写空闲定时任务
写空闲定时任务
lastWriteTime = ticksInNanos();
boolean firstReaderIdleEvent = true;
lastReadTime = ticksInNanos();
channelRead
boolean reading = true;
state = 1
long writerIdleTimeNanos;
add
state = 2
long lastReadTime = ticksInNanos();
取消
收藏
收藏
0 条评论
回复 删除
下一页