Open BornToRain opened 4 years ago
I have some old project code that uses tcp, and I want to use vertx-tcp to proxy them.
I use tcp server and client as a Proxy,tcp-server is running at 8080,tcp-client is running at random port.
when set the verticle instance number greater than or equal to logical cpu number,tcp connection is always waiting.
In my environment, the number is 12, when set the TestVerticle instance number < 12,it can proxy tcp.
vertx-lang-scala_2.12:3.9.1
class TestVerticle extends ScalaVerticle { private[this] lazy val proxy = vertx.createNetServer // 60000-65535 private[this] lazy val randomPort = Random.nextInt(5536) + 60000 override def startFuture() = { proxy.connectHandler { proxy => log.info(s"0.0.0.0:${randomPort} create connection") vertx.createNetClient.connectFuture(randomPort, "0.0.0.0").map { client => log.info("proxy connect success") Pump.pump(proxy, client).start Pump.pump(client, proxy).start } proxy.closeHandler(_ => log.info("0.0.0.0:${randomPort} disconnect connection")) } proxy.listenFuture(8080) } override def stop(): Unit = proxy.close(_ => log.info(s"proxy disconnect connection")) }
@BornToRain can you share a similar projects in Java that we can run to reproduce the issue ?
Questions
I have some old project code that uses tcp, and I want to use vertx-tcp to proxy them.
I use tcp server and client as a Proxy,tcp-server is running at 8080,tcp-client is running at random port.
when set the verticle instance number greater than or equal to logical cpu number,tcp connection is always waiting.
In my environment, the number is 12, when set the TestVerticle instance number < 12,it can proxy tcp.
Version
vertx-lang-scala_2.12:3.9.1
Code snippet
Extra