I am working on upgrading an application using Netty 3 to Netty 4. A lot of the handlers currently have code that look like this:
public class SomeHandler extends SimpleChannelUpstreamHandler {
@Override
public void channelOpen(final ChannelHandlerContext ctx, final ChannelStateEvent e) {
// do stuff with input
// ....
// then call the sendUpstream method
ctx.sendUpstream(e);
}
}
I am looking how to convert this to Netty 4. I see that ChannelOutboundHandlerAdapter
replaces SimpleChannelUpstreamHandler
now, but still couple of questions:
ChannelStateEvent
is no longer available in Netty 4, what is the mechanism to receive channel events now?
- What is
ctx.sendUpstream(e)
doing there, and how can that be replicated in Netty 4?
question from:
https://stackoverflow.com/questions/65934842/what-is-the-replacement-for-channelhandlercontext-sendupstream-in-netty-4 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…