cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl for HTTP Connection pool

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 8 Oct 2016 15:44:38 +0200 (CEST)

On Sat, 8 Oct 2016, Ranjan Khanna wrote:

> I have an application which makes HTTP requests. I need to make a pool of
> connections so that multiple threads can send different HTTP requests at
> same time(dont want to opening a new connection on each request, rather will
> maintain a pool of persistent connections).
>
> Is there any pooling mechanism provided by libcurl to support this or I have
> to do it as part of my application.

libcurl features a connection pool, but only for keeping connections around
after use so they can be used again. There's no way for a user to pre-populate
the pool with connections.

The chapter in the book on connection reuse:

   https://ec.haxx.se/libcurl-connectionreuse.html
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-10-08