一文搞懂Netty发送数据全流程 | 你想知道的细节全在这里(三)
3.2HeadContextfinalclassHeadContextextendsAbstractChannelHandlerContextimplementsChannelOutboundHandler,ChannelInboundHandler{Overridepublicvoidwrite(ChannelHandlerContextctx,Objectmsg,ChannelPromisepromise){unsafe.write(msg,promise);}}write事件最终会在pipeline中传播到HeadContext里并回调HeadContext的write方法。并在write回调中调用channel的unsafe类执行底层的write操作。这里正是write事件在pipeline...