cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Using multi interface

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 26 Oct 2011 15:49:06 +0200 (CEST)

On Wed, 26 Oct 2011, Ellié Computing Open Source Program wrote:

> however, it seems that name resolution is now asynchronous, handled in a
> separate thread, and the multi_fdset/select pair does not do anything
> special:

That's actually not new. It existed even back in 7.16 so I'm not sure why you
see a different behavior now. On Windows, libcurl defaults to doing name
resolves in a separate thread. While the separate thread is running, there's
no particular socket for the application to wait for.

The curl_multi_fdset man page (now) includes details on this.

> the sample seems to consider that on timeout of select(), multi_perform
> should be called. am I right?

Yes, and that's also documented and it it was always the case.

> if yes, it means that with a 1 second timeout on select, it will always take
> 1 second at least to get a first time asynchronous name resolution. right?
> this is not a big deal, I’d just like to be sure that I understood correctly
> my problem.

Yes, that's correct. It is a reason to perhaps consider at least a shorter
first timeout (and then to potentially slowly increase it for each loop?)

-- 
  / daniel.haxx.se

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-10-26