Skip to content

Instantly share code, notes, and snippets.

@zeroFruit
Created July 23, 2022 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeroFruit/a4f4049d6d88ab87993bf5026f27c73f to your computer and use it in GitHub Desktop.
Save zeroFruit/a4f4049d6d88ab87993bf5026f27c73f to your computer and use it in GitHub Desktop.
Channel concept & implementation— el Project (2)
private static final class HeadContextHandler
implements ChannelOutboundHandler, ChannelInboundHandler {
@Override
public void bind(
ChannelHandlerContext ctx, SocketAddress localAddress, ChannelPromise promise) {
ctx.channel().internal().bind(localAddress, promise);
}
@Override
public void connect(
ChannelHandlerContext ctx, SocketAddress remoteAddress, ChannelPromise promise)
throws Exception {
ctx.channel().internal().connect(remoteAddress, promise);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment