Netty 4 multiple client

后端 未结 1 1187
春和景丽
春和景丽 2020-12-11 02:30

I need to make the client is able to make many connections. I use Netty 4.0. Unfortunately all existing examples do not show how to create a lot of connections.



        
相关标签:
1条回答
  • 2020-12-11 03:00

    Yes its almost correct.. The only thing you MUST change is the creation of NioEventLoopGroup on every connect.

    NioEventLoopGroup instances are expensive so they should be shared. Create one instance and share it, by pass the same instance to the Bootstrap.group(...) everytime..

    0 讨论(0)
提交回复
热议问题