cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Questions on using the curl multi interface(som clarification)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 4 Sep 2010 11:10:32 +0200 (CEST)

On Fri, 3 Sep 2010, lali .cpp wrote:

> To get data from multiple urls and enforce a timeout *both on connection
> establishment and data transfer*, for example enforce a connectioin
> establishment timeout of 30ms and data transfer timeout of 75ms.

Those are very short times. I'm not questioning that, I'm only stating facts.

> CURLOPT_CONNECTTIMEOUT_MS(30ms) on each of the easy handles using
> curl_easy_setopt. CURLOPT_CONNECTTIMEOUT_MS is used to enforce connection
> establishment timeout. Is it correct as I would be using multi interface and
> not easy interface?

CURLOPT_CONNECTTIMEOUT does not really work for the multi interface in any
released libcurl version. We're working on making sure it works correctly for
the next release.

> timeout.tv_usec = 75000; // I want to enforce a transfer timeout of 75

Since you're looping and will do the select() call multiple times, you need to
check how long time you've executed and deduct that time from the 75
milliseconds each time you call select() if you want a total time of 75ms and
not 75ms per select() call.

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