cURL / Mailing Lists / curl-library / Single Mail


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

From: Adam Kellas <>
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.


List admin:
Received on 2010-06-03