Skip to content

Commit 47a6573

Browse files
fix deprecation
1 parent 473c8d0 commit 47a6573

File tree

1 file changed

+4
-2
lines changed
  • libp2p/src/testFixtures/kotlin/io/libp2p/tools

1 file changed

+4
-2
lines changed

libp2p/src/testFixtures/kotlin/io/libp2p/tools/TCPProxy.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import io.netty.channel.ChannelFuture
77
import io.netty.channel.ChannelHandlerContext
88
import io.netty.channel.ChannelInboundHandlerAdapter
99
import io.netty.channel.ChannelOption
10+
import io.netty.channel.MultiThreadIoEventLoopGroup
1011
import io.netty.channel.nio.NioEventLoopGroup
12+
import io.netty.channel.nio.NioIoHandler
1113
import io.netty.channel.socket.nio.NioServerSocketChannel
1214
import io.netty.channel.socket.nio.NioSocketChannel
1315
import io.netty.handler.logging.LogLevel
@@ -19,7 +21,7 @@ class TCPProxy {
1921

2022
fun start(listenPort: Int, dialHost: String, dialPort: Int): ChannelFuture {
2123
val future = ServerBootstrap().apply {
22-
group(NioEventLoopGroup())
24+
group(MultiThreadIoEventLoopGroup(NioIoHandler.newFactory()))
2325
channel(NioServerSocketChannel::class.java)
2426
childHandler(
2527
nettyInitializer {
@@ -29,7 +31,7 @@ class TCPProxy {
2931
serverCtx.channel().pipeline().addFirst(LoggingHandler("server", LogLevel.INFO))
3032

3133
Bootstrap().apply {
32-
group(NioEventLoopGroup())
34+
group(MultiThreadIoEventLoopGroup(NioIoHandler.newFactory()))
3335
channel(NioSocketChannel::class.java)
3436
option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 5 * 1000)
3537
handler(object : ChannelInboundHandlerAdapter() {

0 commit comments

Comments
 (0)