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.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to