go to bug id or search bugs for
I'm using pcntl_signal to install a signal handler.
Then I setup a socket, and call socket_set_block to make it blocking.
Then I call sock_recvfrom.
And while the sock_recvfrom is blocked, the party starts...
*If it receives a signal which has not been installed previously with pcntl_signal, the program wake up again and die (expected behaviour).
*If it receives a signal which has been installed with pcntl_signal, it won't wake up, and will call the signal handler when the sock_recvfrom wakes up.
*Finally the SIGALRM seems to be special, and no matter it has been installed or not it'll wake up the process from the sock_recvfrom.
In my opinion it shall treat all the signals as SIGALRM, if somebody wants to block some signals they can do it themselves with pcntl_sigprocmask.
But my point is:
Says: "When an operation (e.g. receive, send, connect, accept, ...) is performed on a blocking socket, the script will pause its execution until it receives a signal or it can perform the operation. "
More on the SIGALRM workaround: http://blog.andrewrose.co.uk/2008/02/php-getting-signals-through-to-blocking.html
Add a Patch
Add a Pull Request