curl / Mailing Lists / curl-library / Single Mail

curl-library

RE: Wait for a response using curl_multi_wait

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 21 Mar 2018 15:35:22 +0100 (CET)

On Tue, 20 Mar 2018, Cunningham, Joel wrote:

> 1) Make the new API behave just poll/select, i.e. it can be used as a
> blocking construct even when there are no input FDs.

I decided to make an attempt and it turned out making a new
function called curl_multi_poll() that does exactly this requried a *minimal*
change:

   https://github.com/curl/curl/pull/2415

There's no docs and no tests or anything but I'm interested in thoughts and
feedback. It basically acts exactly like curl_multi_wait, *but* if there's
nothing to wait for it will wait for the timeout period (or shorter if the
multi handle as a timeout set that expires before the given timeout).

If we are to add a new function, we might as well make sure that we correct
all the problems we can think of while at it!

An alternative design could be to add a curl_multi_setopt() option that
changes how curl_multi_wait() behaves, but I figure that is slightly more
subtle...

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2018-03-21