stream_select problem with signals
| From: | Marcos Lois Bermúdez | Date: | Fri, 15 Feb 2008 13:54:38 +0000 |
| Subject: | stream_select problem with signals | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-269362@lists.php.net to get a copy of this message | ||
I'm rewriting an API to access OneWire Net, i have a problem with select
and signals. The class will support both types of sockets, trought BSD
sockets and with streams.
My problem is that when the PHP app is in socket select and a signal
arrives it threat it as a error, so i can fix in socket_select using
socket_last_error in this form:
$n = socket_select($_read, $_write, $_except, $sec, $usec);
if($n === false) {
if(socket_last_error($this->_sock) == 0) {
// signal break the select
$timeout -= (microtime(true) - $start);
} else {
// Error, not interrupted by signal
return false;
}
} else {
return $n;
}
This work, but i can't determine if a signal interrupted the
stream_select, there is a way to detect this?
Regards.