We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
新增 ChannelPipelineHook netty 业务编排的处理器钩子接口,用于游戏对外服。
ExternalServerBuilder 新增 channelPipelineHook ,用于自定义 netty 业务编排的处理器。
废弃标记 ExternalServerBuilder.channelHandlerProcessors 属性及其相关地方为过期,由 ChannelPipelineHook 来代替,使用示例如下。
使用示例代码
public class ExternalServerBuilderApplication { public static void main(String[] args) { // netty ChannelHandler 编排 var myChannelPipelineHook = new ChannelPipelineHook() { @Override public void initChannelPipeline(ChannelPipeline pipeline) { pipeline.addLast("ExternalBizHandler", new ExternalBizHandler()); // pipeline.addFirst("ssl", ssl) } }; // 游戏对外服构建器 ExternalServerBuilder builder = ExternalServer.newBuilder(10100); builder.channelPipelineHook(myChannelPipelineHook); } }
通常情况下,这样的编排方式也会更加清晰,因为代码统一在这里做编排了。
开发者在自定义业务编排时,可以通过这个钩子接口,比如添加一个 SSL。
注意事项:在调用 hook 前,会经过 ExternalChannelInitializerCallback.initChannelPipeline(SocketChannel) 。 ExternalChannelInitializerCallback 接口的实现类有
这些实现类中,会给 ChannelPipeline 添加上一些默认的处理器,通常是编解码相关的。
The text was updated successfully, but these errors were encountered:
🐳
9649317
(#28) ExternalServerBuilder 新增 channelPipelineHook ,用于自定义 netty 业务编排的处理器。 标记 ExternalServerBuilder.channelHandlerProcessors 属性及其相关地方为过期,由 ChannelPipelineHook 来代替,使用示例如下。
🐳 17.1.26
4e0d4df
(#27、#28)
iohao
No branches or pull requests
新增 ChannelPipelineHook netty 业务编排的处理器钩子接口,用于游戏对外服。
ExternalServerBuilder 新增 channelPipelineHook ,用于自定义 netty 业务编排的处理器。
废弃标记 ExternalServerBuilder.channelHandlerProcessors 属性及其相关地方为过期,由 ChannelPipelineHook 来代替,使用示例如下。
使用示例代码
通常情况下,这样的编排方式也会更加清晰,因为代码统一在这里做编排了。
开发者在自定义业务编排时,可以通过这个钩子接口,比如添加一个 SSL。
注意事项:在调用 hook 前,会经过 ExternalChannelInitializerCallback.initChannelPipeline(SocketChannel) 。
ExternalChannelInitializerCallback 接口的实现类有
这些实现类中,会给 ChannelPipeline 添加上一些默认的处理器,通常是编解码相关的。
The text was updated successfully, but these errors were encountered: