Skip to content

Commit f6c773d

Browse files
authored
Merge pull request #323 from Junze888/develop
fix core dump error for linux
2 parents c07a281 + 0378ac7 commit f6c773d

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

src/main/java/io/xdag/net/websocket/WebSocketServer.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,14 @@
2525

2626
import io.netty.bootstrap.ServerBootstrap;
2727
import io.netty.channel.*;
28-
import io.netty.channel.epoll.EpollEventLoopGroup;
29-
import io.netty.channel.kqueue.KQueueEventLoopGroup;
3028
import io.netty.channel.nio.NioEventLoopGroup;
3129
import io.netty.channel.socket.SocketChannel;
3230
import io.netty.channel.socket.nio.NioServerSocketChannel;
3331
import io.netty.handler.codec.http.HttpObjectAggregator;
3432
import io.netty.handler.codec.http.HttpServerCodec;
35-
import io.netty.util.NettyRuntime;
3633
import io.xdag.Kernel;
3734
import lombok.Getter;
3835
import lombok.extern.slf4j.Slf4j;
39-
import org.apache.commons.lang3.SystemUtils;
4036

4137
import javax.annotation.Nullable;
4238
import 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

Comments
 (0)