cURL / Mailing Lists / curl-library / Single Mail

curl-library

HTTP connection keep alive?

From: Lai, Andy <hlai_at_informatica.com>
Date: Wed, 9 Nov 2005 15:09:13 -0800

Hi,

According to http://curl.haxx.se/libcurl/c/curl_easy_setopt.html, the library will try to reuse existing connection by default (if CURLOPT_FORBID_REUSE and CURLOPT_FRESH_CONNECT are 0).

I have some basic questions about the http connection behavior...

1. If I keep posting data to the same URL, only one socket connection will be opened right?
2. This is the same as keep alive support defined in http 1.1 right?
3. When will the connection be closed? If I post to a different URL, will that close my existing connection? Or are they both maintained in a connection pool?
4. If my network connection is broken between two HTTP posts, will the second post be able to detect it and open a new connection?

Thanks!
Andy
Received on 2005-11-10