62,621
社区成员
发帖
与我相关
我的任务
分享
this.channelGroup = AsynchronousChannelGroup.withFixedThreadPool(this.threadCount, Executors.defaultThreadFactory());
// this.channelGroup = AsynchronousChannelGroup.withFixedThreadPool(this.threadCount, Executors.privilegedThreadFactory());
// this.channelGroup = AsynchronousChannelGroup.withCachedThreadPool(Executors.newCachedThreadPool(), this.threadCount);
this.serverChannel = AsynchronousServerSocketChannel.open(this.channelGroup);
this.serverChannel.setOption(StandardSocketOptions.SO_REUSEADDR, true);
this.serverChannel.bind(this.address);
if (this.serverChannel.isOpen()) {
Connection connection = new Connection();
this.serverChannel.accept(connection, new ConnectionAcceptHandler());
}