RE: [PHP] Open 10 http connections in parallel
| From: | Steve Edberg | Date: | Fri, 09 Aug 2002 03:51:42 +0000 |
| Subject: | RE: [PHP] Open 10 http connections in parallel | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-111764@lists.php.net to get a copy of this message | ||
I've never done this before, but you probably could open these connections via a socket, and set them all non-blocking. Presumably you'd them have to write a loop that polled all connections to check if they'd closed, or time them out after some number of seconds. See
http://php.he.net/manual/en/function.socket-set-blocking.php
and
http://php.he.net/manual/en/ref.network.php
-steve
At 1:28 PM +1000 8/9/02, Martin Towell <martin.towell@world.net> wrote:
use C and fork() php (AFAIK) can't do parallel programming -----Original Message----- From: NoWhErEMan [mailto:vckh@yahoo.com] Sent: Friday, August 09, 2002 12:58 PM To: php-general@lists.php.net Subject: [PHP] Open 10 http connections in parallel Hello, I had to write a script to open 10 http connections for different links and get the response from the host. I do it by fopen each url one by one and save the response to a separated file. But it slow! I wonder if i can open 10 connnect (or more) in parallel? Thanks in advance. NoWhErEMaN-- +------------------------------------------------------------------------+ | Steve Edberg sbedberg@ucdavis.edu | | University of California, Davis (530)754-9127 | | Programming/Database/SysAdmin http://pgfsun.ucdavis.edu/ | +------------------------------------------------------------------------+ | The end to politics as usual: | | The Monster Raving Loony Party (http://www.omrlp.com/) | +------------------------------------------------------------------------+