cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to cleanly close the curl socket in case of multi interface?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 19 Sep 2014 13:34:14 +0200 (CEST)

On Fri, 19 Sep 2014, nikhil ap wrote:

> I do like to keep the connection persistent in some cases and close in some
> other.

libcurl assumes persistent connections and will make its best to keep
connections alive and then possibly re-use them. You can use
CURLOPT_FORBID_REUSE to explicitly mark transfers to forbid subsequent
requests to re-use the connection that transfer uses.

Related, but probably not what you want here, you can use
CURLOPT_FRESH_CONNECT on an easy handle to force it to not re-use an existing
connection.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2014-09-19