cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: can I limit the number of simultaneous transfers with the multi API?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 3 Jun 2010 11:10:29 +0200 (CEST)

On Wed, 2 Jun 2010, Adam Kellas wrote:

> I check the multi handle to see if there's an "idle" easy handle. If so I
> use it, if not I create a new handle and add it to the stack. Thus, when
> doing 407 simultaneous transfers I may have 407 easy handles on the multi
> stack

Well, there you go. That will then potentially create 407 simultaneous
connections. If you want to limit the amount of parallellism, you limit the
rate you add new handles. You can for example use the counter that
curl_multi_perform() provides to know how many active transfers there are, to
keep your quota where you want it to be.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-06-03