curl / Mailing Lists / curl-library / Single Mail

curl-library

RE: Wait for a response using curl_multi_wait

From: Cunningham, Joel <Joel.Cunningham_at_garmin.com>
Date: Wed, 21 Mar 2018 18:53:18 +0000

> -----Original Message-----
> From: curl-library [mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of
> Daniel Stenberg
> Sent: Wednesday, March 21, 2018 9:35 AM
> To: libcurl development <curl-library_at_cool.haxx.se>
> Subject: RE: Wait for a response using curl_multi_wait
>
> 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).

Great, I like the name! I'll take a look at the PR and post any feedback

>
> 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...
>

Ahh, I didn't think of a setopt. That's a better way to control the behavior without breaking the API, but I prefer the simplicity of curl_multi_poll 😊

Joel

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