Page 1 of 1

curl => don't wait execution

Posted: Thu Aug 28, 2008 1:48 pm
by ddragas
Hi all

is there a way to tell CULR not to wait execution of URL given, or is it possible to setup CURL curl_setopt($ch, CURLOPT_TIMEOUT, 0.00001);

thank you all

kind regards

ddragas

Re: curl => don't wait execution

Posted: Fri Aug 29, 2008 5:40 am
by chakhar86
can I suggest you multi-threading?

Re: curl => don't wait execution

Posted: Fri Aug 29, 2008 5:59 am
by onion2k
chakhar86 wrote:can I suggest you multi-threading?
Now tell him how to write multi-threaded PHP code.

Hint: You can't.

You can use Multi Curl though - http://www.phpied.com/simultaneuos-http ... with-curl/ - it's not really the same as not waiting for the response though. If you just need to send a request to a page without waiting, or caring about, the response then an exec() call to wget might be a better option. Or alternatively you could use fsockopen() and set the socket to non-blocking. There's lots of ways of doing this sort of thing.