cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Select returns -1 on all the multi examples in win32

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 16 Nov 2014 11:57:55 +0100 (CET)

On Sat, 15 Nov 2014, Ray Satiro wrote:

> Ok. To state the obvious the timeout behavior is different depending on
> platform now. In the case of platforms other than Windows if there are no
> fds select() will still sleep whatever is in timeout, which could be less
> than the recommended minimum value of 100ms depending on what is returned by
> curl_multi_timeout(). I assume that will result in excess looping. But I
> tried to produce that just now in Ubuntu 14 and couldn't since
> curl_multi_fdset is always returning fds for me. Should the multi examples
> be changed for the other platforms as well to sleep 100ms when there are no
> fds ready?

Yes, I think it makes sense to make them behave similarly so a 100ms sleep
would be good even for non-windows with maxfd is -1, if nothing else to match
what we're saying in the docs!

The reason you don't get -1 on your Ubuntu is probably because it doesn't ship
a libcurl built with the threaded resolver. With the other resolver backends,
there will always be a socket to return.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2014-11-16