Peeyush
Peeyush

Reputation: 4828

How to create channel pool in netty?

I am creating channel using this sample code:

 EventLoopGroup group = new NioEventLoopGroup();
        try {
            Bootstrap b = new Bootstrap();
            b.group(group)
             .channel(NioSocketChannel.class)
             .option(ChannelOption.SO_KEEPALIVE, true)
             .handler(new ClientInitializer());

            // Start the connection attempt.
            Channel ch = b.connect(host, port).sync().channel();

So here my getting a channel(channel future) but my application throughput will be very high so i think that one channel will not be sufficient, so please let me know that how do i create channel pool.

I am using netty 4.0

Upvotes: 1

Views: 12561

Answers (1)

Netty Learning
Netty Learning

Reputation: 102

Please refer ChannelPool section at http://netty.io/news/2015/05/07/4-0-28-Final.html

Upvotes: 5

Related Questions