Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
517 views
in Technique[技术] by (71.8m points)

netty4 - What is the replacement for ChannelHandlerContext.sendUpstream in Netty 4

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:

  1. ChannelStateEvent is no longer available in Netty 4, what is the mechanism to receive channel events now?
  2. 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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
...