Skip to content

Latest commit

 

History

History
12 lines (6 loc) · 667 Bytes

channelpipeline.md

File metadata and controls

12 lines (6 loc) · 667 Bytes

ChannelPipeline

ChannelPipeline是ChannelHandler的容器,一个ChannelPipeline包含多个ChannelHandler,ChannelHandler包含在ChannelHandlerContext中,如图

ChannelPipeline中的ChannelHandlerContext是按链式存储的,ChannelPipeline包含了自动创建的HeadChannelHandlerContext和TailChannelHandlerContext分别作为链的头和尾。向ChannelPipeline添加一个ChannelHandler的时候,会创建一个新的ChannelHandlerContext加入到链中,ChannelHandler包含在ChannelHandlerContext中,如图