netty常用内置Handler

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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值