src/Network/Connection.php
private function isDataOnStream()
    {
        $read = [$this->connection];
        $write = null;
        $except = null;
        $hasStreamInfo = @stream_select($read, $write, $except, 0);

        if ($hasStreamInfo === false) {
            // can return `false` if used in combination with `pcntl_signal` and lead to false errors here
            $error = error_get_last();
            if ($error && isset($error['message']) && stripos($error['message'], 'interrupted system call') === false) {
                throw new ConnectionException(
                    'Check failed to determine if the socket is readable.',
                    $this->activeHost
                );
            }
            return null;
        }

        return !empty($read);
    }
private function isDataOnStream()
    {
        $read = [$this->connection];
        $write = null;
        $except = null;
        $hasStreamInfo = @stream_select($read, $write, $except, 0);

        if ($hasStreamInfo === false) {
            // can return `false` if used in combination with `pcntl_signal` and lead to false errors here
            $error = error_get_last();
            if ($error && isset($error['message']) && stripos($error['message'], 'interrupted system call') === false) {
                throw new ConnectionException(
                    'Check failed to determine if the socket is readable.',
                    $this->activeHost
                );
            }
            return null;
        }

        return !empty($read);
    }
private function isDataOnStream ( ) { $ read = [ $ this -> connection ] ; $ write = null ; $ except = null ; $ hasStreamInfo = @ stream_select ( $ read , $ write , $ except , 0 ) ; if ( $ hasStreamInfo === false ) { // can return `false` if used in combination with `pcntl_signal` and lead to false errors here $ error = error_get_last ( ) ; if ( $ error && isset ( $ error [ 'message' ] ) && stripos ( $ error [ 'message' ] , 'interrupted system call' ) === false ) { throw new ConnectionException ( 'Check failed to determine if the socket is readable.' , $ this -> activeHost ) ; } return null ; } return ! empty ( $ read ) ; }
Checks if there is readable data on the stream.

Will return true if data is available, false if no data is detected and null if the operation was interrupted.

@return bool|null
@throws ConnectionException
Checks if there is readable data on the stream .