Close the connection if it has been established.
974898
public function disconnect() : void
    {
        if ($this->dbconn->inTransaction()) {
            $this->dbconn->rollBack();
        }
        $this->dbconn = null;
        $this->is_connected = false;
    }
265332
def close(self):
        """"""
        if self.connection:
            self.connection.close()
            self.connection = None
            logging.debug("Connection closed.")
148145
def release(self, connection):
        """"""
        self._checkpid()
        if connection.pid == self.pid:
            idx = connection._pattern_idx
            self._in_use_connections[idx].remove(connection)
            self._available_connections[idx].append(connection)
565600
def close_connection(self, connection: str) -> None:
        
        if connection not in self.connections:
            raise ConnectionNotOpen(connection)

        self.connections.pop(connection).close()
896164
def close(self):
        """"""
        logger('HttpConnection').debug('Closing connection....')
        self.writer.close()
        self._closed = True
525472
function _close()
	{
		if ($this->_connectionID) $this->_connectionID->Close();
		$this->_connectionID = false;
		return true;
	}
1354434
def _on_closed(self):
        """"""
        self._connected.clear()
        if not self._closing:
            if self._on_close_callback:
                self._on_close_callback()
            else:
                raise exceptions.ConnectionError('closed')
635159
def close(self):
        
        if not self._connected.is_set():
            raise exceptions.ConnectionError('not connected')
        self._closing = True
        if self._clustering:
            for host in self._cluster.keys():
                self._cluster[host].close()
        elif self._connection:
            self._connection.close()
213084
def close(self):
        
        try:
            self.connection.close()
            self.connection = None
        except Exception:
            if not self.fail_silently:
                raise
1144341
private function close() {
		$this->ehlo = null;
		if ($this->connection->isOpen()) {
			$this->connection->close();
			$this->log('ehlo reseted, connection closed', false);
		}
	}
1278901
def close(self):
        """"""
        if not self.is_running:
            return

        self._state = CLOSED
        self.logger.debug('closing connection(s)')

        while True:
            try:
                conn = self._connections.get(block=False)
            except Empty:
                break

            conn.close_stream()

        self.on_close.send(self)
770559
def stop(self):
        """"""
        self._stop_thread.set()
        # f you want to close the connection in a timely fashion,
        # call shutdown() before close().
        with self._lock:  # Receive thread might use the socket
            self.receive_socket.shutdown(socket.SHUT_RDWR)
            self.receive_socket.close()

        self.send_socket.shutdown(socket.SHUT_RDWR)
        self.send_socket.close()
993882
def Close(self):
		
		if self.connection is not None:
			try:
				self.connection.commit()
				self.connection.close()
				self.connection = None
			except Exception, e:
				pass
54695
def disconnect(self):
        
        if self.con is not None:
            self.con.close()
            log.debug('Closed connection with with set-top box at %s:%s.',
                      self.ip, self.port)
460297
def stop(self):
        """"""

        _logger.debug("Emitting quit signal for connections.")
        self.__quit_ev.set()

        _logger.info("Waiting for connection manager to stop.")
        self.__manage_g.join()
794026
def close(self):
        
        LOGGER.debug('Connection %s closing', self.id)
        if self.busy:
            raise ConnectionBusyError(self)
        with self._lock:
            if not self.handle.closed:
                try:
                    self.handle.close()
                except psycopg2.InterfaceError as error:
                    LOGGER.error('Error closing socket: %s', error)
632771
private function _closeConnection()
    {
        if (!$this->ftp) {
            return;
        }
        if (!$this->isSFTP()) {
            ftp_close($this->ftp);
            $this->ftp = null;
        }
    }