cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Mailing List Archives

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

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 2 Jun 2010 19:47:02 +0200 (CEST)

On Wed, 2 Jun 2010, Adam Kellas wrote:

> My application uses libcurl (7.20.1) to upload many files to a single
> dedicated server. The multi API is used for speed, and it works great.
> However, I've found that when the number of simultaneous transfers gets too
> large some data is lost at the server end (the test case that generates
> breakage is around 400 parallel transfers). This is very likely NOT a
> libcurl bug, more probably a limitation of the server, but I'd like to try
> addressing it by enhancing our client to allow a limit on parallel transfers
> to be configured.

So how many easy handles do you add to the multi handle? And btw, what OS are
you doing this on?

> I see there is a CURLMOPT_MAXCONNECTS setting but this seems to be a little
> different. Does anyone have example code showing how to limit the number of
> active transfers to 10 or 100 or so?

You control that by not adding more handles than you want to be transfered in
parallell. CURLMOPT_MAXCONNECTS is then used to make sure than no more than
the specified amount is kept open.

-- 
  / 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-02

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET