curl-library
Re: HTTP connection keep alive?
Date: Thu, 10 Nov 2005 00:18:09 +0100 (CET)
On Wed, 9 Nov 2005, Lai, Andy wrote:
> 1. If I keep posting data to the same URL, only one socket connection will
> be opened right?
Yes.
> 2. This is the same as keep alive support defined in http 1.1 right?
Yes.
> 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?
There is a pool. We call it "connection cache". The size of the cache is 5
connections by default (change with CURLOPT_MAXCONNECTS).
Connections are kept alive as far as possible. They are closed when you call
*_cleanup(), you use an option that makes it close or if the server closes.
> 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?
Yes.
-- Commercial curl and libcurl Technical Support: http://haxx.se/curl.htmlReceived on 2005-11-10