close

Close the connection if any.

@return Connection $this
773630
public function close()
    {
        if ($this->hasHandler()) {
            pg_close($this->handler);
            $this->handler = null;
            $this->is_closed = true;
        }

        return $this;
    }
1324051
public function disconnect()
    {
        $streamResource = $this->getStreamResource();

        if (is_resource($streamResource)) {
            stream_socket_shutdown($streamResource, STREAM_SHUT_RDWR);
            $this->streamResource = null;
        }

        return $this;
    }
253111
protected function closeFtpConnection()
    {
        if (is_resource($this->ftpConnection)) {
            ftp_close($this->ftpConnection);
        }

        $this->ftpConnection = null;
    }
114174
public function close()
        {
            if (is_resource($this->fd)) {
                $this->send(self::TYPE_DISCONNECT);
                fclose($this->fd);

                return true;
            }

            return false;
        }
737486
public function disconnect()
    {
        if ($this->_isValidService()) {
            $this->getService()->quit();
            $this->_service = null;
            $this->_connected = false;
        }

        return $this;
    }
1223400
protected function disconnect()
    {
        // Initiate connection close. The WebSockets RFC recomends against
        // clients initiating the close handshake but we want to ensure the
        // connection is closed as soon as possible.
        $this->connection->startClose(
            Net_Notifier_WebSocket_Connection::CLOSE_GOING_AWAY,
            'Client sent message.'
        );

        // read server close frame
        $state = $this->connection->getState();

        $sec  = intval($this->timeout / 1000);
        $usec = ($this->timeout % 1000) * 1000;

        while ($state < Net_Notifier_WebSocket_Connection::STATE_CLOSED) {
            $read = array($this->socket->getRawSocket());

            $result = stream_select(
                $read,
                $write = null,
                $except = null,
                $sec,
                $usec
            );

            if ($result === 1) {
                $this->connection->read(self::READ_BUFFER_LENGTH);
            } else {
                // read timed out, just close the connection
                $this->connection->close();
            }

            $state = $this->connection->getState();
        }

        $this->connection = null;
    }
375922
public function closeConnection()
    {
        // release statement and close connection(s)
        $this->last_result = null;
        foreach ($this->dbhs as $dbh) {
            oci_close($dbh);
        }

        parent::closeConnection();
    }
1210964
public function disconnect()
    {
        if ($this->socket) {
            $this->push('QUIT');

            fclose($this->socket);

            $this->socket = null;
        }

        return $this;
    }
662297
private function connect()
    {
        if (is_null($this->connection)) {
            $this->connection = call_user_func($this->connectionFactory, $this->config);
        }

        return $this;
    }
225752
public function disconnect() {
        if ($this->isConnected()) {
            $sqlite = $this->sqlite;
            $this->sqlite = null;
            $sqlite->close();
        }
        return $this;
    }
919342
public function disconnect() {
        if ($this->_sock) {
            fclose($this->_sock);
            $this->_sock = null;
        }
        return $this;
    }
827260
public function disconnect()
    {
        if ($this->isConnected()) {
            $this->_connection->close();
            $this->_connection = null;
            $this->_connected  = false;
        }

        return $this;
    }
394578
public function disconnect()
	{
		// Close the connection.
		if (is_callable($this->connection, 'close'))
		{
			mysqli_close($this->connection);
		}

		$this->connection = null;
	}
1034573
public function destroy()
    {
        $this->redis->flushDb();
        $this->close();
        $this->redis = null;

        return $this;
    }
945588
public static function closeDbConnection()
    {
        if (isset(self::$dbLink)) {
            $dbConn = self::$dbLink;
            $dbConn->close();
            self::$dbLink = null;
        }
        
        return null;
    }
861169
protected function limit()
    {
        if (($connectionLimit = config('ratchet.connectionLimit')) && $this->connections - 1 >= $connectionLimit) {
            $this->console->info(sprintf('To many connections: %d of %d', $this->connections - 1, $connectionLimit));
            $this->conn->send(trans('ratchet::messages.tooManyConnections'));
            $this->conn->close();
        }

        return $this;
    }
902098
public function close()
    {
        if(isset($this->_link))
            $this->_link->close();

        if(isset($this->_sequencePool))
            $this->_sequencePool->close();

        return $this;
    }