Created
July 23, 2022 00:26
-
-
Save zeroFruit/11c80e1ef75e1d60f62a95964890ca5c to your computer and use it in GitHub Desktop.
Channel concept & implementation— el Project (2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DefaultChannelPipeline implements ChannelPipeline { | |
@Override | |
public ChannelPromise bind(SocketAddress localAddress) { | |
return this.tailContext.bind(localAddress); | |
} | |
@Override | |
public ChannelPromise bind(SocketAddress localAddress, ChannelPromise promise) { | |
return this.tailContext.bind(localAddress, promise); | |
} | |
@Override | |
public ChannelPromise connect(SocketAddress remoteAddress, ChannelPromise promise) { | |
return this.tailContext.connect(remoteAddress, promise); | |
} | |
private static final class TailContext extends AbstractChannelHandlerContext { | |
private final TailContextHandler handler; | |
public TailContext(ChannelPipeline pipeline) { | |
super(HEAD_NAME, pipeline, null, TailContextHandler.class); | |
this.handler = new TailContextHandler(); | |
} | |
@Override | |
public ChannelHandler handler() { | |
return this.handler; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment