cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Adam Kellas <Adam.Kellas_at_gmail.com>
Date: Thu, 03 Jun 2010 10:38:07 -0400

On 6/3/2010 5:10 AM, Daniel Stenberg wrote:
> 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.

Thanks, I've done something of this nature and it works.

AK

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