cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Multiple Calls to Curl to do Multiple Downloads with each Call

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 21 Feb 2014 22:15:40 +0100 (CET)

On Fri, 21 Feb 2014, Phil Welch wrote:

> So, before I move in that direction I thought I'd ask if there's any example
> code where Curl is called multiple times [and] processes an array of url
> downloads during each iteration.  Again, 1 at a time is not a problem; many
> at a time is.

With the multi interface you just add handles, any number of handles, and they
will all be handled in parallel. There's really no difference between adding
one handle or 999 handles for an application.

Seen in this simple example:

   http://curl.haxx.se/libcurl/c/multi-double.html

Or this rather advanced multi_socket API example:

   http://curl.haxx.se/libcurl/c/hiperfifo.html (using libevent, but there are
also several ones using other event libraries)

-- 
  / daniel.haxx.se

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