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
345097
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);
    }
227900
public static function isConnected()
    {
        try {
            $connected = (
                isset(self::$_connection['id'])
                && !is_null(self::$_connection['id'])
            );
        } catch (Exception $ex) {
            return false;
        }

        return $connected;
    }
5724
protected function _read($length = null) {
		if (!$this->connected) {
			$message = 'No connection found while reading data from socket.';
			throw new RuntimeException($message);
		}
		if ($length) {
			if (feof($this->_connection)) {
				return false;
			}
			$data = stream_get_contents($this->_connection, $length + 2);
			$meta = stream_get_meta_data($this->_connection);

			if ($meta['timed_out']) {
				$message = 'Connection timed out while reading data from socket.';
				throw new RuntimeException($message);
			}
			$packet = rtrim($data, "\r\n");
		} else {
			$packet = stream_get_line($this->_connection, 16384, "\r\n");
		}
		return $packet;
	}
1215158
public function connected()
    {
        if (is_resource($this->smtp_conn)) {
            $sock_status = stream_get_meta_data($this->smtp_conn);
            if ($sock_status['eof']) {
                // The socket is valid but we are not connected
                $this->edebug(
                    'SMTP NOTICE: EOF caught while checking if connected',
                    self::DEBUG_CLIENT
                );
                $this->close();

                return false;
            }

            return true; // everything looks good
        }

        return false;
    }
964890
public function isReadable(): bool
    {
        if ($this->readable === null) {
            $this->readable = false;
            if ($this->isAttached() === true) {
                $meta = $this->getMetadata();
                foreach (self::$modes['readable'] as $mode) {
                    if (strpos($meta['mode'], $mode) === 0) {
                        $this->readable = true;
                        break;
                    }
                }
            }
        }

        return $this->readable;
    }
971324
public function isNullable()
    {
        if (null === $this->nullable) {
            return null;
        }

        return $this->nullable || 'null' === strtolower($this->getDefault() ?? '');
    }
675666
private function checkVisitorDataIsReliable()
    {
        $data = $this->getVisitorData();

        foreach (['user_id', 'client_ip', 'user_agent'] as $key) {
            if ($this->checkDataIsUnreliable($data, $key)) return false;
        }

        return true;
    }
1304523
protected function _read($length = null) {
		if (!$this->connected && !$this->connect()) {
			return false;
		}
		if ($length) {
			if (feof($this->_connection)) {
				return false;
			}
			$data = stream_get_contents($this->_connection, $length + 2);
			$meta = stream_get_meta_data($this->_connection);

			if ($meta['timed_out']) {
				$this->_error('Connection timed out.');
				return false;
			}
			$packet = rtrim($data, "\r\n");
		} else {
			$packet = stream_get_line($this->_connection, 16384, "\r\n");
		}
		return $packet;
	}
1340852
protected function _is_conn()
	{
		if ( ! is_resource($this->_conn_id))
		{
			if ($this->_debug == true)
			{
				throw new \InvalidArgumentException('Invalid connection');
			}
			return false;
		}
		return true;
	}
139924
public function isReadable() {
		$m = substr($this->mode, 0, 1);
		$p = strlen($this->mode) > 1 ? substr($this->mode, 1, 2) : "";
		return ($m == "r" || $p == "+");
	}
966454
protected function fileExistsAndReadable ()
	{
		if ($this->isDataStream === true)
		{
			return;
		}
		
		if (stristr($this->fileName, 'http://') !== false)
		{
			$this->remoteImage = true;
			return;
		}
		
		if (!file_exists($this->fileName))
		{
			$this->triggerError('Image file not found: ' . $this->fileName);
		}
		elseif (!is_readable($this->fileName))
		{
			$this->triggerError('Image file not readable: ' . $this->fileName);
		}
	}
1330205
public function isPaginationable()
    {
        return ! is_null($this->request->input('start')) &&
            ! is_null($this->request->input('length')) &&
            $this->request->input('length') != -1;
    }
911120
protected function httpReadHeaders()
    {
        while (($l = $this->readLine()) !== null) {
            if ($l === '') {
                return true;
            }
            $e = explode(': ', $l);
            if (isset($e[1])) {
                $this->currentHeader = 'HTTP_' . strtoupper(strtr($e[0], Generic::$htr));
                $this->server[$this->currentHeader] = $e[1];
            } elseif (($e[0][0] === "\t" || $e[0][0] === "\x20") && $this->currentHeader) {
                // multiline header continued
                $this->server[$this->currentHeader] .= $e[0];
            } else {
                // whatever client speaks is not HTTP anymore
                $this->badRequest();
                return false;
            }
        }
        return null;
    }
723610
public function isConnected()
    {
        $result = false;
        if($entity = $this->getIterator()->current()) {
            $result = $entity->isConnected();
        }

        return $result;
    }
1050706
public boolean readable(final Object socketOrChannel)
    {
        final PollItem it = filter(socketOrChannel, READABLE);
        if (it == null) {
            return false;
        }
        return it.isReadable();
    }
371613
public function check()
    {
        $this->isFound = file_exists($this->filename);
        $this->isReadable = is_readable($this->filename);

        $result = $this->isFound && $this->isReadable;

        return $result;
    }
75072
public function isReadable() {

		if(false !== $this -> file -> getExists()) {

			$this -> refresh();
			
			return $this -> file -> getReadable();
		}

		return false;
	}