Re: [PHP4BETA] select() Design Notes
| From: | Christian Schneider | Date: | Sat, 04 Dec 1999 04:49:14 +0000 |
| Subject: | Re: [PHP4BETA] select() Design Notes | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-7381@lists.php.net to get a copy of this message | ||
Evan Klinger wrote:
> and $ret could be:
> a) false // timeout
> b) a single fd-resouce
> c) an array of fp-resources with their status.
Hmm.. why not mimic the UNIX/C behaviour?
$ret = number of fds (see man select)
and input arrays would be modified to contain fds which caused select() to
return.
$ret gives you easy way to determine what happened, arrays are easy to examine
as well. If you return an array of fds instead you run into the problem of
marking which fd were readable vs. writeable vs. got an exception. Especially if
you have the same fd in read and write fdset.
But then again, maybe I'm too used to using select() with C :-)
More opinions?
- Chris
--
Chris Schneider, mailto:cschneid@relog.ch
Computers are not intelligent. They only think they are.