public function select($timeout = 0) {
        $read = [$this->socket];
        $write = null;
        $except = null;

        $sec = floor($timeout / 1000);
        $usec = $timeout % 1000;
        if($this->socketsEnabled) {
            $select = socket_select($read, $write, $except, $sec, $usec);
        } else {
            $select = stream_select($read, $write, $except, $sec, $usec);
        }

        return $select > 0;
    }
public function select($timeout = 0) {
        $read = [$this->socket];
        $write = null;
        $except = null;

        $sec = floor($timeout / 1000);
        $usec = $timeout % 1000;
        if($this->socketsEnabled) {
            $select = socket_select($read, $write, $except, $sec, $usec);
        } else {
            $select = stream_select($read, $write, $except, $sec, $usec);
        }

        return $select > 0;
    }
public function select ( $ timeout = 0 ) { $ read = [ $ this -> socket ] ; $ write = null ; $ except = null ; $ sec = floor ( $ timeout / 1000 ) ; $ usec = $ timeout % 1000 ; if ( $ this -> socketsEnabled ) { $ select = socket_select ( $ read , $ write , $ except , $ sec , $ usec ) ; } else { $ select = stream_select ( $ read , $ write , $ except , $ sec , $ usec ) ; } return $ select > 0 ; }
Waits for data to be read from this socket before the specified timeout
occurs

@param int $timeout The number of milliseconds to wait for data arriving
on this socket before timing out
@return bool whether data arrived on this socket before the timeout
Waits for data to be read from this socket before the specified timeout occurs