Re: sockets
| From: | J Smith | Date: | Sun, 28 Apr 2002 23:18:56 +0000 |
| Subject: | Re: sockets | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-83462@lists.php.net to get a copy of this message | ||
You can kind of simulate multithreading with the sockets extension by using
socket_select(). Technically, the result is multiplexing and not
multithreading, but in the end, it works quite nicely -- you can handle
multiple incoming/outgoing connections without the need for forking or
multiple threads.
Handling multiple sockets is definitely do-able in PHP, and it's relatively
easy to set up. There should be an example I wrote somewhere in the
archives.
J
Dan Hardiker wrote:
> The only feature which would be useful towards this module is threading.
> If PHP were able to thread it could handle multiple incoming sockets and
> neglegate the need for IPC between child processes (where PCNTL has been
> used) as it could all be handled by a common parent with shared (not
> copied) variables.
>
> Just my 2p's worth
>