Close stale connections.
330567
@Override
    public void closeStaleConnections() {

        logger.debug("closeStaleConnections() count before expiring: {}", getConnectionCount());

        connectionProvider.forEach((key, connection) -> {
            if (isStale(key)) {
                connectionProvider.close(key);
            }
        });

        logger.debug("closeStaleConnections() count after expiring: {}", getConnectionCount());
    }
1361050
def sync_close_connection(self):
        """"""
        loop = asyncio.get_event_loop()
        task = loop.create_task(self.close_connection())
        loop.run_until_complete(task)
880495
def flush_down_connections(self):
        
        self._get_db_attempts = 0
        for db_num in self._down_connections.keys():
            self.mark_connection_up(db_num)
1176617
def close(self):
        """"""
        # Instead of actually closing the connection,
        # return it to the pool so it can be reused.
        if self._con is not None:
            self._pool.returnConnection(self._con)
            self._con = None
738933
def flush(self):
        # type: () -> None
        
        if self._closed:
            raise IOError('tried to flush closed connection')
        assert self._parentout is not None
        self._parentout.flush()
813297
async def close(self):
        """"""
        conn = self._connection
        if conn is None:
            return
        try:
            while (await self.nextset()):
                pass
        finally:
            self._connection = None
1085289
void dropRemoteConnections()
    {
        final String methodName = "dropRemoteConnections";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.entry(this, TRACE, methodName);
        }

        if (_connectedRemotely)
        {
            closeConnections();
        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.exit(TRACE, methodName);
        }
    }
885454
def close_connection (self):
        """"""
        if self.url_connection is not None:
            try:
                self.url_connection.quit()
            except Exception:
                pass
            self.url_connection = None
697617
def unconnect(self, *funcs):
        """"""
        for func in funcs:
            for callbacks in self._callbacks.values():
                if func in callbacks:
                    callbacks.remove(func)
780785
final public void close() {
		List<C> connsToClose;
		synchronized(poolLock) {
			// Prevent any new connections
			isClosed = true;
			// Find any connections that are available and open
			connsToClose = new ArrayList<>(availableConnections.size());
			for(PooledConnection<C> availableConnection : availableConnections) {
				synchronized(availableConnection) {
					C conn = availableConnection.connection;
					if(conn!=null) {
						availableConnection.connection = null;
						connsToClose.add(conn);
					}
				}
			}
			poolLock.notifyAll();
		}
		// Close all of the connections
		for(C conn : connsToClose) {
			try {
				close(conn);
			} catch(Exception err) {
				logger.log(Level.WARNING, null, err);
			}
		}
	}
1265492
async def clear(self):
        """"""
        async with self._cond:
            while self._free:
                conn = self._free.popleft()
                await conn.ensure_closed()
            self._cond.notify()
68769
def remove_connection(self, connection):
        """"""
        if not self._closing:
            self.connections.remove(connection)
            logger.debug("removed connection")
838341
def close(self):
        """"""
        self._lock.acquire()
        try:
            while self._idle_cache:  # close all idle connections
                con = self._idle_cache.pop(0)
                try:
                    con.close()
                except Exception:
                    pass
            if self._maxshared:  # close all shared connections
                while self._shared_cache:
                    con = self._shared_cache.pop(0).con
                    try:
                        con.close()
                    except Exception:
                        pass
                    self._connections -= 1
            self._lock.notifyAll()
        finally:
            self._lock.release()
326945
def _disconnect_hanging_devices(self):
        """"""

        now = monotonic()
        for uuid, data in self._connections.items():
            if (now - data['last_touch']) > self.client_timeout:
                self._logger.info("Disconnect inactive client %s from device 0x%X", data['client'], uuid)
                self._loop.add_callback(self._disconnect_from_device, uuid, data['key'], data['client'], unsolicited=True)
669842
public void purgeClosedConnection(OutboundConnection connection)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "purgeClosedConnection", connection);
        connection.getConnectionData().getConnectionDataGroup().purgeClosedConnection(connection);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "purgeClosedConnection");
    }
619832
public void deinit() {

        if (channel != null) try {
            channel.close();
        } catch (IOException | TimeoutException e) {
            log.warn("Failed to close channel in RabbitMQ connector");
        }

        if (connection != null) try {
            connection.close();
        } catch (IOException e) {
            log.warn("Failed to close connection in RabbitMQ connector");
        }

    }
692218
def close(self):
        """"""

        if self.closed:
            return

        # Make sure no one minds the connection to be closed
        # This will help avoid MemoryError in other threads,
        # they will get sqlite3.ProgrammingError instead
        if not self.personal_lock.acquire(timeout=self.lock_timeout):
            raise LockTimeoutError(self)

        try:
            try:
                if self.in_transaction:
                    self.db_state.active_connection = None
                    self.db_state.transaction_lock.release()
            except sqlite3.ProgrammingError:
                pass

            if self._cursor is not None and not self._cursor.closed:
                self._cursor._cursor.close()
                self._cursor.closed = True

            if self.connection is not None:
                self.connection.close()

            self.closed = True
        finally:
            self.personal_lock.release()