cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: questions about the PHP cURL multi interace

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 28 Jul 2006 12:50:43 +0200 (CEST)

On Thu, 27 Jul 2006, Terra Frost wrote:

> I sent this to curl-and-php_at_cool.haxx.se but it was suggested that I instead
> send it here, so...

It was? You're talking about PHP/CURL details so this is hardly the right
list.

> The second parameter of curl_multi_exec (or curl_multi_perform as it's named
> in the docs) represents how many socket connections are still open.

No, curl_multi_perform() returns the number of "still running" easy handles in
that counter. It is not a socket counter.

> I tried to load three URLs - the last of which had sleep(5) in it to test
> this and the return value remained 3 until the very end. Should't it reduce
> down to 1 really fast and then remain 1 for most of the programs duration?

Yes, I would think so.

> Also, this tutorial (http://curl.haxx.se/libcurl/c/libcurl-tutorial.html)
> contains the only refence to curl_multi_select that I've been able to find.

Then check again, it does not mention curl_multi_select since that is not a
function libcurl offers.

> My interpretation of that is that curl_multi_select based on that
> description is that it blocks until curl_multi_perform has something to do.

That's how select() works, yes.

> But that doesn't explain the return value.

'man select'

> Also, the tutorial mentions curl_multi_fdset - a function for which I can
> find no PHP equivalent. Does PHP's curl_multi_exec make this function
> unnecessary?

Ask the PHP guys.

> Back to the return value of curl_multi_select. There's a sample of
> curl_multi_select being used at php.net (
> http://us2.php.net/manual/en/function.curl-multi-exec.php#48813). It checks
> to see if curl_multi_select's value is -1. What does that mean?

Ask the PHP guys.

> Looking at the error codes (
> http://curl.haxx.se/libcurl/c/libcurl-errors.html) suggests that -1 is
> CURLM_CALL_MULTI_PERFORM
> but I don't think that means a whole lot sense if it did

It certainly sounds very wrong to me too.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-07-28