curl / Mailing Lists / curl-library / Single Mail


RE: Wait for a response using curl_multi_wait

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

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

Received on 2018-03-21