cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: curl_multi_fdset always returns -1 for maxfd

From: Vishakha Vaidya <vvaidya_at_adobe.com>
Date: Wed, 12 Nov 2014 14:49:04 +0000

> -----Original Message-----
> From: curl-library [mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Daniel Stenberg
> Sent: Wednesday, November 12, 2014 6:43 PM
> To: libcurl development
> Subject: RE: curl_multi_fdset always returns -1 for maxfd
>
> On Wed, 12 Nov 2014, Vishakha Vaidya wrote:
>
> > If I avoid both curl_multi_fdset(multi_handle, &fdread, &fdwrite,
> > &fdexcep, &maxfd); and select(maxfd+1, &fdread, &fdwrite, &fdexcep,
> > &timeout); Just use curl_multi_perform(multi_handle, &still_running);
> > the code works, is that the right way to do it?
>
> No. You want curl_multi_fdset() to figure out what to wait for, but if there's nothing to wait for you can/should just wait a short while instead of calling select().
>
> Further desrcibed in the man page:
> http://curl.haxx.se/libcurl/c/curl_multi_fdset.html
>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html

It doesn't work. Unless I keep calling multi_perform in a loop, the state does not change from CURLM_STATE_WAITRESOLVE to CURLM_STATE_WAIT_CONNECT.
Are you unable to reproduce the problem, with the code I sent?

~Vishakha

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-11-12