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();
取消