cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Persistent connections with libCurl

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 24 Apr 2010 10:57:28 +0200 (CEST)

On Thu, 22 Apr 2010, Rahul R wrote:

> I am using new curl handle for every new request coming in. Curl caches
> socket connections to different hosts. In this case(using new curl handle
> for every request), will curl use the cached socket connection or it will
> create new connection for every request ?

You didn't give us enough details. What libcurl version on what OS? And are
you using the easy or the multi interfaces?

Assuming you use the easy interface, then each easy handle will hold a pool of
connections so you should strive to re-use the same easy handle as much and as
far as possible to get persistent connections, DNS cache and more.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-04-24