check if the connection is still active

@return bool
332667
public function isValid() {
		if (is_resource($this->process)) {
			$status = proc_get_status($this->process);
			return $status['running'];
		} else {
			return false;
		}
	}
1191604
public function isAlive($reconnect = false)
    {
        if (!$this->driver->systype($this->resource)) {
            if ($reconnect) {
                return $this->connect();
            }

            return false;
        }

        return true;
    }
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;
    }
1229652
public boolean isAlive(Connection conn)
    {
        try
        {
            return con != null ? !con.isClosed() : false;
        }
        catch (SQLException e)
        {
            log.error("IsAlive check failed, running connection was invalid!!", e);
            return false;
        }
    }
795440
public function isConnected()
    {
        try {
            return \is_resource($this->connection) && \ftp_rawlist($this->connection, $this->getRoot()) !== false;
        } catch (\ErrorException $e) {
            if (\strpos($e->getMessage(), 'ftp_rawlist') === false) {
                throw $e;
            }

            return false;
        }
    }
633403
public function status()
	{
		try
		{
			$pingRequest = $this->connection->createPing();
			$ping = $this->connection->ping($pingRequest);
			$pong = $ping->getData();
			$alive = false;

			if (isset($pong['status']) && $pong['status'] === "OK")
			{
				return true;
			}
		}
		catch (\Solarium\Exception $e)
		{
			return false;
		}
	}
1348159
public function isLocked()
    {
        $result = false;
        if(!$this->isNew())
        {
            if(isset($this->locked_on) && isset($this->locked_by))
            {
                $locked  = strtotime($this->locked_on);
                $current = strtotime(gmdate('Y-m-d H:i:s'));

                //Check if the lock has gone stale
                if($current - $locked < $this->_lifetime)
                {
                    $userid = $this->getObject('user')->getId();
                    if($this->locked_by != 0 && $this->locked_by != $userid) {
                        $result= true;
                    }
                }
            }
        }

        return $result;
    }
602732
public function active()
    {
        $classes = $this->getAdaptee()->classes;

        foreach ($classes as $class) {
            if (strpos($class, 'current') !== false) {
                return true;
            }
        }

        return false;
    }
416718
public function isAlive()
    {
        if ( $this->attribute( 'status' ) != self::STATUS_WORKING )
            throw new Exception( 'The process\'s status isn\'t \'working\'' );

        // sending 0 only checks if the process is alive (and if the current process is allowed to send signals to it)
        $return = ( posix_kill( $this->attribute( 'pid' ), 0 ) === true );
        return $return;
    }
1309910
public function isCurrent()
    {
        $link = $this->getLink();
        if ($link{0} == '/') {
            $link = substr($link, 1);
        }

        return request()->is($link);
    }
277507
public function isAlive()
    {
        $pid = pcntl_waitpid($this->_pid, $status, WNOHANG);
        $this->result = unserialize(trim(socket_read($this->sockets[1], $this->message_length)));
        socket_close($this->sockets[1]);

        return ($pid === 0);
    }
1341940
public function isConnected(): bool
    {
        try{
            return false !== $this->instance->getAttribute(\PDO::ATTR_SERVER_INFO);
        } catch (\Throwable $e) {
        }
        return false;
    }
1233816
public function isSslConnection()
	{
		$serverSSLVar = $this->input->server->getString('HTTPS', '');

		if (!empty($serverSSLVar) && strtolower($serverSSLVar) !== 'off')
		{
			return true;
		}

		$serverForwarderProtoVar = $this->input->server->getString('HTTP_X_FORWARDED_PROTO', '');

		return !empty($serverForwarderProtoVar) && strtolower($serverForwarderProtoVar) === 'https';
	}
954368
public function canConnect()
    {
        $data = $this->get(self::CURRENT_USER_ENDPOINT);
        if (strpos($data['code'], '2') === 0) {
            return true;
        }
        return false;
    }
351363
public boolean isConnectionStale() {
        if (lastUsedTime == 0)
            return false;

        long currentTime = System.currentTimeMillis();
        long timeSinceLastUse = currentTime - lastUsedTime;
        return (timeSinceLastUse > MAX_KEEPALIVE);
    }
1203967
public function ping() {

		$canConnect = false;

		foreach ( $this->httpRequests as $httpRequest ) {
			if ( !$httpRequest->ping() ) {
				return false;
			}

			$canConnect = true;
		}

		return $canConnect;
	}
745835
public function isConnectionClose()
    {
        $connection = $this->getHeader('connection');

        if ($this->protocolVersion === '1.1') {
            return ($connection[0] === 'C' || $connection[0] === 'c');
        } else {
            return ($connection[0] !== 'K' && $connection[0] !== 'k');
        }
    }