cURL / Mailing Lists / curl-library / Single Mail


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

From: Daniel Stenberg <>
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.

List admin:
Received on 2014-11-16