Re: stream_select problem with signals

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marcos Lois Bermúdez wrote:
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.

socket_strerror(socket_last_error()) maybe?

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux