curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Wait for a response using curl_multi_wait

From: Richard Copley <rcopley_at_gmail.com>
Date: Wed, 21 Mar 2018 18:24:46 +0000

On 21 March 2018 at 14:35, Daniel Stenberg <daniel_at_haxx.se> wrote:

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

Probably a stupid question, but in the example I was talking about, where
does the socket returned by connect() fit in? After the first SYN packet
has been sent, and before the SYN/ACK arrives, can't curl wait on that
socket?

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