Re: Conversion of socket_fd to PHP 4.2 system?
| From: | Markus Fischer | Date: | Mon, 05 Aug 2002 14:45:34 +0000 |
| Subject: | Re: Conversion of socket_fd to PHP 4.2 system? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-86530@lists.php.net to get a copy of this message | ||
On Mon, Aug 05, 2002 at 08:40:31AM -0400, Michael Worsham wrote :
> A past programmer developed a piece of code using the PHP 4.1.1 series to use the socket_fd_*
> code. However, with the release of PHP 4.2, the 'fd' code is no longer valid.
>
> $fdr = socket_fd_alloc();
> $fdz = socket_fd_alloc();
>
> function socket_canread($sock) {
> global $fdr, $fdz;
> socket_fd_set($fdr, $sock);
> socket_select($fdr, $fdz, $fdz, 0, 10);
> $r = socket_fd_isset($fdr, $sock);
> socket_fd_zero($fdr);
> socket_fd_zero($fdz);
> return $r;
> }
>
> Can someone help me translate the following piece to use the newer PHP 4.2 socket code?
You don't need the special fd resources anymore. Pass an
array with the sockets directly to socket_select(). For more
information see php.net/socket_select, read this archive and
study the sources.
- Markus
--
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
<Fabian> hwaaraSick: unsignificant
<hwaaraSick> Fabian: can you be more precise?
<Fabian> hwaaraSick: negligible