diff --git a/dc3-driver/dc3-driver-listening-virtual/src/main/java/io/github/pnoker/driver/service/netty/tcp/NettyTcpServer.java b/dc3-driver/dc3-driver-listening-virtual/src/main/java/io/github/pnoker/driver/service/netty/tcp/NettyTcpServer.java index b0c51ac71..d1ca0ccd7 100644 --- a/dc3-driver/dc3-driver-listening-virtual/src/main/java/io/github/pnoker/driver/service/netty/tcp/NettyTcpServer.java +++ b/dc3-driver/dc3-driver-listening-virtual/src/main/java/io/github/pnoker/driver/service/netty/tcp/NettyTcpServer.java @@ -18,11 +18,8 @@ package io.github.pnoker.driver.service.netty.tcp; import io.netty.bootstrap.ServerBootstrap; -import io.netty.channel.Channel; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.*; +import io.netty.channel.nio.NioIoHandler; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; import io.netty.handler.codec.bytes.ByteArrayEncoder; @@ -64,7 +61,7 @@ public class NettyTcpServer { */ @SneakyThrows public void start(int port) { - EventLoopGroup group = new NioEventLoopGroup(); + EventLoopGroup group = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory()); try { ServerBootstrap bootstrap = new ServerBootstrap(); bootstrap.group(group) diff --git a/dc3-driver/dc3-driver-listening-virtual/src/main/java/io/github/pnoker/driver/service/netty/udp/NettyUdpServer.java b/dc3-driver/dc3-driver-listening-virtual/src/main/java/io/github/pnoker/driver/service/netty/udp/NettyUdpServer.java index b2f20b52e..6348a0298 100644 --- a/dc3-driver/dc3-driver-listening-virtual/src/main/java/io/github/pnoker/driver/service/netty/udp/NettyUdpServer.java +++ b/dc3-driver/dc3-driver-listening-virtual/src/main/java/io/github/pnoker/driver/service/netty/udp/NettyUdpServer.java @@ -18,11 +18,8 @@ package io.github.pnoker.driver.service.netty.udp; import io.netty.bootstrap.Bootstrap; -import io.netty.channel.Channel; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.*; +import io.netty.channel.nio.NioIoHandler; import io.netty.channel.socket.nio.NioDatagramChannel; import io.netty.handler.timeout.WriteTimeoutHandler; import lombok.SneakyThrows; @@ -51,7 +48,7 @@ public class NettyUdpServer { */ @SneakyThrows public void start(int port) { - EventLoopGroup group = new NioEventLoopGroup(); + EventLoopGroup group = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory()); try { Bootstrap bootstrap = new Bootstrap(); bootstrap.group(group)