@Override
public void configure(NetworkChannelHandler handler) {
this.handler = handler;
final boolean useEpoll = Epoll.isAvailable() && this.configuration.getBoolean("epoll");
this.eventLoopGroup = useEpoll ? new EpollEventLoopGroup(this.configuration.getInt("threads")) :
new NioEventLoopGroup(this.configuration.getInt("threads"));
bootstrap.group(this.eventLoopGroup);
bootstrap.channel(useEpoll ? EpollSocketChannel.class : NioSocketChannel.class);
bootstrap.option(ChannelOption.SO_KEEPALIVE, true);
bootstrap.option(ChannelOption.TCP_NODELAY, true);
}
NettyNetworkingClient.java 文件源码
java
阅读 43
收藏 0
点赞 0
评论 0
项目:Coerce
作者:
评论列表
文章目录