简体   繁体   中英

Making one http request with Netty

In all of the http examples for Netty the client is making just one request and then closes all resources.

In order to make the request two new thread pulls are created:

ClientBootstrap bootstrap = new ClientBootstrap(
              new NioClientSocketChannelFactory(
                        Executors.newCachedThreadPool(),
                        Executors.newCachedThreadPool()));

And I'm wondering if this is necessary for just one request, especially when the requests in the examples are synchronized, isn't there a simpler way to make that just one request?

Thanks.

Why do you need Netty for just one request? There are simpler ways to do that. Using of Netty implies working with heavy load.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM