netty(八) netty中自带channelhandler

SslHandler:负责对请求进行加密和解密,是放在ChannelPipeline中的第一个ChannelHandler

HttpClientCodec和HttpServerCodec:HttpClientCodec负责将请求字节解码为HttpRequest、HttpContent和LastHttpContent消息,以及对应的转为字节;HttpServerCodec负责服务端中将字节码解析成HttpResponse、HttpContent和LastHttpContent消息,以及对应的将它转为字节
HttpServerCodec 里面组合了HttpResponseEncoder和HttpRequestDecoder

HttpClientCodec 里面组合了HttpRequestEncoder和HttpResponseDecoder

HttpObjectAggregator: 负责将http聚合成完整的消息,而不是原始的多个部分
HttpContentCompressor和HttpContentDecompressor:HttpContentCompressor用于服务器压缩数据,HttpContentDecompressor用于客户端解压数据
IdleStateHandler:连接空闲时间过长,触发IdleStateEvent事件
ReadTimeoutHandler:指定时间内没有收到任何的入站数据,抛出ReadTimeoutException异常,并关闭channel
WriteTimeoutHandler:指定时间内没有任何出站数据写入,抛出WriteTimeoutException异常,并关闭channel
DelimiterBasedFrameDecoder:使用任何用户提供的分隔符来提取帧的通用解码器
FixedLengthFrameDecoder:提取在调用构造函数时的定长帧
ChunkedWriteHandler:将大型文件从文件系统复制到内存【DefaultFileRegion进行大型文件传输】

WebSocketServerProtocolHandler:处理websocket协议,将HttpServerCodec转为websocketFrame,处理websocket握手


---------------------
作者:爬蜥
来源:CSDN
原文:https://blog.csdn.net/weixin_39687783/article/details/80792930

posted on   风再起时9302  阅读(532)  评论(0编辑  收藏  举报

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示