cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Persistent connections with libCurl

From: Rahul R <rahulr_1982_at_yahoo.com>
Date: Wed, 28 Apr 2010 15:47:24 +0530 (IST)

Daniel, Thanks for your reply. Here are some more details: I am using libCurl version 7.19.6 on Windows Server 2003. I am using curl easy interface. Right now, i am using new handle for every new request. To reuse the handles, consider i have to connect to multiple hosts A, B, C and D and send requests initially using handles hA, hB, hC and hD to send requests to A, B, C and D respectively. Now, if i decide to reuse the handles i can reuse any of these handles to connect to any of the hosts and still be able to achieve persistent connections ? For example, i can use hA to connect to hosts B, C, D also and later on whenever i use hA for host A, B, C or D the cached connection will be used.(As every handle caches 5 connections). Can someone please confirm this ? ________________________________ From: Daniel Stenberg <daniel@haxx.se> To: libcurl development <curl-library@cool.haxx.se> Sent: Sat, 24 April, 2010 2:27:28 PM Subject: Re: Persistent connections with libCurl 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

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