0

As far as I understand, in Netty ChannelOutboundHandlerAdapter is meant for outbound IO operations: that is writes, but a class implementing ChannelOutboundHandlerAdapter can also implement a read method, which seems incorrect to me, why should a component meant for writing have a read method.

The opposite component, that is ChannelInboundHandlerAdapter which is meant for inbound IO operations, ie reads, does not have a write method. This sounds correct.

Why does ChannelOutboundHandlerAdapter makes it possible to implement a read method if it is supposed to push data out of the pipeline?

4

1 回答 1

1

read() signals the willingness to read something from the socket as soon as there is something that can be read. It basically tells netty that we should do a read at some point.

于 2021-03-24T19:32:49.590 回答