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:
ChannelOutboundHandlerAdapter
SimpleChannelUpstreamHandler
ChannelStateEvent
ctx.sendUpstream(e)
you would override channelActive(...) in this case and call ctx.fireChannelActive() as a replacement for sendUpstream(...)
channelActive(...)
ctx.fireChannelActive()
sendUpstream(...)
1.4m articles
1.4m replys
5 comments
57.0k users