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: Fri, 23 Mar 2018 11:37:28 +0000

On 23 March 2018 at 08:43, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Tue, 20 Mar 2018, Richard Copley wrote:
>
> I might have misunderstood you. If curl_multi_wait returns with numfds=0,
>> then there is no point trying to read the data.
>>
>
> When curl_multi_wait() returns, you should call curl_multi_perform() no
> matter what numfds says though since there are also timeouts involved that
> aren't reflected in numfds.
>
> (Barring the busy-loop problem already being discussed that is.)

OK, thanks.

I'm getting a bit lost. My comment there was in reply to Eric, who said:

>I checked my own code, I don't
>wait inside such loop and actually use the waiting of curl_multi_wait for
all my internal
>timing needs. I never check numfds either and just proceed to
curl_multi_perform/curl_multi_info_read.
>This example isn't doing that so you don't see what happens. Maybe the
data is just there?

But I think the example [1] does call curl_multi_perform after every
curl_multi_wait.

In any case, I think what I said about "no point trying to read the
data" doesn't
make much sense, and I take it back.

[1] https://curl.haxx.se/libcurl/c/multi-single.html

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