95-33-020-ChannelHandler-ChannelHandler简介


Insert picture description here

1 Overview

​ ChannelHandler has no methods to handle events, but needs to be handled by subclasses: ChannelInboundHandler intercepts and handles inbound events, ChannelOutboundHandler intercepts and handles outbound events. We have already understood that the events in ChannelPipeline will not flow automatically, and we generally need events to flow automatically. Netty provides two Adapters: ChannelInboundHandlerAdapter and ChannelOutboundHandlerAdapter to meet this demand. The implementation is similar to the following:

// inboud事件默认处理过程
public void 

Guess you like

Origin blog.csdn.net/qq_21383435/article/details/114787631