Any difference between ctx.write() and ctx.channel().write() in netty?

前端 未结 1 335
故里飘歌
故里飘歌 2021-01-04 13:25

I noticed that the ctx is different from handler to handler even these handlers are in the same pipeline, for example

    p.addLast(\"myHandler1\", new MyHan         


        
相关标签:
1条回答
  • 2021-01-04 14:16

    Yes there is... Channel.write(..) always start from the tail of the ChannelPipeline and so pass through all the ChannelOutboundHandlers. ChannelHandlerContext.write(...) starts from the current position of the ChannelHandler which is bound to the ChannelHandlerContext and so only pass those ChannelOutboundHandlers that are in front of it.

    0 讨论(0)
提交回复
热议问题