cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Keeping cURL handle between uses, depending on time period?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 15 Aug 2015 23:28:33 +0200 (CEST)

On Sat, 15 Aug 2015, nils_at_meditalk.com wrote:

> To keep the cURL handle between transmissions is a recommended procedure. If
> I am expecting to send messages no closer than 5 seconds up to minutes
> apart, is it a case when I ought to keep the handle open?

> If so, what kind of cleanup need I do in between transmissions?

> Can I check the validity of the handle to see if a new one should be opened?
> (The transmitting RaspberryPi will be a standalone CPU, expected to run for
> years without intervention !)

You can always re-use a handle, and libcurl will re-use connections if it can
or it will create new ones if it has.

The recommendation is to re-use as much as you can.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2015-08-16