2525
2626import io .netty .bootstrap .ServerBootstrap ;
2727import io .netty .channel .*;
28- import io .netty .channel .epoll .EpollEventLoopGroup ;
29- import io .netty .channel .kqueue .KQueueEventLoopGroup ;
3028import io .netty .channel .nio .NioEventLoopGroup ;
3129import io .netty .channel .socket .SocketChannel ;
3230import io .netty .channel .socket .nio .NioServerSocketChannel ;
3331import io .netty .handler .codec .http .HttpObjectAggregator ;
3432import io .netty .handler .codec .http .HttpServerCodec ;
35- import io .netty .util .NettyRuntime ;
3633import io .xdag .Kernel ;
3734import lombok .Getter ;
3835import lombok .extern .slf4j .Slf4j ;
39- import org .apache .commons .lang3 .SystemUtils ;
4036
4137import javax .annotation .Nullable ;
4238import java .util .List ;
@@ -52,18 +48,8 @@ public class WebSocketServer {
5248 private final PoolHandShakeHandler poolHandShakeHandler ;
5349
5450 public WebSocketServer (Kernel kernel , List <String > poolWhiteIPList , int port ) {
55- int workerThreadPoolSize = NettyRuntime .availableProcessors () * 2 ;
56- if (SystemUtils .IS_OS_LINUX ) {
57- this .bossGroup = new EpollEventLoopGroup ();
58- this .workerGroup = new EpollEventLoopGroup (workerThreadPoolSize );
59- } else if (SystemUtils .IS_OS_MAC ) {
60- this .bossGroup = new KQueueEventLoopGroup ();
61- this .workerGroup = new KQueueEventLoopGroup (workerThreadPoolSize );
62-
63- } else {
64- this .bossGroup = new NioEventLoopGroup ();
65- this .workerGroup = new NioEventLoopGroup (workerThreadPoolSize );
66- }
51+ this .bossGroup = new NioEventLoopGroup ();
52+ this .workerGroup = new NioEventLoopGroup ();
6753 this .poolHandShakeHandler = new PoolHandShakeHandler (kernel , poolWhiteIPList , port );
6854 ServerBootstrap b = new ServerBootstrap ();
6955 b .group (bossGroup , workerGroup )
0 commit comments