cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Starting to learn curl-multi

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 4 Jan 2006 13:22:01 +0100 (CET)

On Wed, 4 Jan 2006, Broekhuis,Robert R. wrote:

> I've finally jumped into the multi-threading options offered by php/curl,
> since my applications sorely need the increased processing speed.

The multi interface of libcurl (and thus also of PHP/CURL) is _not_
multi-threaded. It is offering multiple transfers using a single thread.

> Unfortunately, the php site isn't exactly forthcoming with detailed
> information. Is there a good online source of information on this set of
> functions?

AFAIK, only the php.net site has those functions documented. The PHP/CURL
functions have never been very throroughly described and I doubt it'll happen
in any near future either...

It *might* help to read the overview docs for plain libcurl and its multi
interface: http://curl.haxx.se/libcurl/c/libcurl-multi.html

> I'm thankful for the few examples offered by users of the php site, which
> I've been able to gently adapt to meet most of my needs - but I can't say I
> fully understand what they are doing. For example, how do I use
> curl-multi-select?

I figure that is the PHP/CURL version of curl_multi_fdset() and thus it
extracts info from libcurl to allow your app to select() for actions on the
sockets libcurl handles.

> What circumstances will cause the multi-operation as a whole to fail (as
> opposed to individual connections)?

When something *REALLY* serious goes wrong.

> When using single-thread functions in the past, I happily reused the same
> handle over and over, with a single init() up front and a single close() at
> the end. This does not appear to work for multi-thread handles - must I
> init()/close() them for every use

Then something is wrong. Either in your app, in PHP/CURL or in libcurl...

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-01-04