Re: Re: Bug #17022: enhance socket_strerror(errno) tomakeerrno optional
| From: | Tom Robinson | Date: | Mon, 06 May 2002 19:21:55 +0000 |
| Subject: | Re: Re: Bug #17022: enhance socket_strerror(errno) tomakeerrno optional | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-83764@lists.php.net to get a copy of this message | ||
>> What do you mean with psocket() ?
Oops! - I meant pselect().
To allow one thread to wait for anything: sockets, signals and timeout.
It is likely to be more robust than signal handlers a la pcntl_signal, because those can interrupt
PHP execution at any time, and that is asking for trouble.
I see that pcntl is incompatible with Zend optimizer, and I would not be surprised if it might be
unreliable in many other circumstances as well.
If signals are acted upon only at a point where they are expected, this has got to be good for
reliability.
pselect would be much easier to make compatible with Zend optimizer, other optimizers, Apache
mod_php etc.
On operating systems where pselect does not exist, PHP socket_pselect could fake it fairly cleanly
with a signal handler that catches signals and sets flags, but does not divert the flow of PHP
execution. The signals would not be acted upon until the next socket_pselect function is called.
The two schemes could even be mixed: pcntl_signal for some signals (such as immediate semi-clean
daemon shutdown) and socket_pselect for others.
...Tom