cURL / Mailing Lists / curl-library / Single Mail


HTTP connection keep alive?

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


According to, 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?

Received on 2005-11-10