Re: [PHP4BETA] select() Design Notes
| From: | Christian Schneider | Date: | Sat, 04 Dec 1999 14:43:45 +0000 |
| Subject: | Re: [PHP4BETA] select() Design Notes | ||
| References: | 1 2 3 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-7396@lists.php.net to get a copy of this message | ||
Evan Klinger wrote:
> Good point. However, there'd still need to be a fd_set(fd_resource)
> function to see if the fd_resource is set. Or am I missing something?
Hmm... FD_ISSET() is the name of the corresponding function/macro.
You could leave the fds in the same position inside the array and replace all
non-matching ones with -1 (invalid) which would closely mimic the C-Version.
But OTOH I think it's easier to have the array contain just the valid ones.
Acting on the fds would then be a foreach ($array as $fd) ...
Is there something I'm missing? Mixed type fds could be handled with something
like forach ($read_fds as $fd) $fdhandlers[$fd]->read($fd);
- Chris
--
Chris Schneider, mailto:cschneid@relog.ch
Computers are not intelligent. They only think they are.