1、new IdleStateHandler(this.readerIdleTime, this.writerIdleTime, this.allIdleTime, this.timeUnit))
根据你设置的超时参数的类型和值,循环去检测channelRead和write方法多久没有被调用了,如果这个时间超过了你设置的值,那么就会触发对应的事件,read触发read,write触发write,all触发all
2、LengthFieldBasedFrameDecoder自定义长度解码器
公式: 发送数据包长度 = 长度域的值 + lengthFieldOffset + lengthFieldLength + lengthAdjustment
参考:https://blog.csdn.net/thinking_fioa/article/details/80573483
3、DelimiterBasedFrameDecoder
4、LineBasedFrameDecoder
5、FixedLengthFrameDecoder
大型文件传输
FileRegion
6、ChunkedWriteHandler异步写大型数据流,不会导致大量内存消耗
7、序列化
JBoss Marshalling
protobuf