NettyNetworkingClient.java 文件源码

java
阅读 43 收藏 0 点赞 0 评论 0

项目:Coerce 作者:
@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);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号