Drop the client connection, e.g. when a NoConnectionsException is caught.
It will try to reconnect as needed and appropriate.
@param clientToDrop caller-provided client to avoid re-nulling from another thread that comes in later
550177
protected synchronized void dropClient(ClientImpl clientToDrop) {
        Client currentClient = this.client.get();
        if (currentClient != null && currentClient == clientToDrop) {
            try {
                currentClient.close();
                this.client.set(null);
            }
            catch (Exception x) {
                // ignore
            }
        }
        this.users = 0;
    }
274278
protected void removeConnection(ConnectionImpl connection) {
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.entry(tc, "removeConnection", connection);

        synchronized (_connections) {
            _connections.remove(connection);
        }

        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.exit(tc, "removeConnection");
    }
1355843
@Override
    final public void removeConnectionEventListener(
                                                    final ConnectionEventListener listener) {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, "removeConnectionEventListener", listener);
        }

        synchronized (_connectionListeners) {
            _connectionListeners.remove(listener);
        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, "removeConnectionEventListener");
        }

    }
1213700
private void updateOtherClientConnected() throws IOException
    {
        final byte cid = in.readByte();
        final String cname = readString();
        for (final ConnectionListener listener : listeners)
        {
            listener.notifyClientConnected(Byte.valueOf(cid), cname);
        }
    }
797245
void removeClient(ClientSocket client)
    {
        if (client != null)
        {
            toRemove.add(client);
            client.terminate();
            clientsNumber--;
            willRemove = true;
            Verbose.info(SERVER, client.getName(), " disconnected");
        }
    }
851791
def stopTrying(self):
        
        protocol.ReconnectingClientFactory.stopTrying(self)
        if not self._client_ready.called:
            self._client_ready.errback(
                pika.exceptions.AMQPConnectionError(
                    u"Could not connect, reconnection cancelled."
                )
            )
1345322
public void reconnect (int timeout) throws IOException {
		if (connectHost == null) throw new IllegalStateException("This client has never been connected.");
		connect(timeout, connectHost, connectTcpPort, connectUdpPort);
	}
549678
public void dropConnection(String name, String database) {
        RequestExecutor requestExecutor = _store.getRequestExecutor(ObjectUtils.firstNonNull(database, _store.getDatabase()));

        DropSubscriptionConnectionCommand command = new DropSubscriptionConnectionCommand(name);
        requestExecutor.execute(command);
    }
703939
public void removeBOSHClientConnListener(
            final BOSHClientConnListener listener) {
        if (listener == null) {
            throw(new IllegalArgumentException(NULL_LISTENER));
        }
        connListeners.remove(listener);
    }
302432
@Override
    public void closeConnection(Object connection) {
        if (connection!=null) {
            ((SoccomClient)connection).close();
            connection = null;
        }
    }
1012444
public void stopConnection() throws CommunicationException, KeystoreException {
		processedFailedNotifications();
		try {
			logger.debug("Closing connection");
			this.socket.close();
		} catch (Exception e) {
			/* Do not complain if connection is already closed... */
		}
	}
281848
private void disconnect(FTPClient client) throws IOException {
    if (client != null) {
      if (!client.isConnected()) {
        throw new FTPException("Client not connected");
      }
      boolean logoutSuccess = client.logout();
      client.disconnect();
      if (!logoutSuccess) {
        LOG.warn("Logout failed while disconnecting, error code - "
            + client.getReplyCode());
      }
    }
  }
892626
protected ConnectionListener removeConnectionListener(boolean free, Collection<ConnectionListener> listeners)
   {
      if (free)
      {
         for (ConnectionListener cl : listeners)
         {
            if (cl.changeState(FREE, IN_USE))
               return cl;
         }
      }
      else
      {
         for (ConnectionListener cl : listeners)
         {
            if (cl.getState() == IN_USE)
               return cl;
         }
      }

      return null;
   }
288577
private void timeoutConnections(final long currentTime, final HostThreadData data) {
        int idleConnections = data.availableConnections.size();
        for (;;) {
            ConnectionHolder holder;
            if (idleConnections > 0 && idleConnections > coreCachedConnections && (holder = data.availableConnections.peek()) != null) {
                if (!holder.clientConnection.isOpen()) {
                    // Already closed connections decrease the available connections
                    idleConnections--;
                } else if (currentTime >= holder.timeout) {
                    // If the timeout is reached already, just close
                    holder = data.availableConnections.poll();
                    IoUtils.safeClose(holder.clientConnection);
                    idleConnections--;
                } else {
                    if (data.timeoutKey != null) {
                        data.timeoutKey.remove();
                        data.timeoutKey = null;
                    }
                    // Schedule a timeout task
                    final long remaining = holder.timeout - currentTime + 1;
                    data.nextTimeout = holder.timeout;
                    data.timeoutKey = WorkerUtils.executeAfter(holder.clientConnection.getIoThread(), data.timeoutTask, remaining, TimeUnit.MILLISECONDS);
                    return;
                }
            } else {
                // If we are below the soft limit, just cancel the task
                if (data.timeoutKey != null) {
                    data.timeoutKey.remove();
                    data.timeoutKey = null;
                }
                data.nextTimeout = -1;
                return;
            }
        }
    }
376428
@Override
	public final Promise disconnect() {
		if (client != null) {
			client.close();
			client = null;
		} else if (clusteredClient != null) {
			clusteredClient.close();
			clusteredClient = null;
		}
		return super.disconnect();
	}
1218675
@Override
	public final Promise disconnect() {
		if (client != null) {
			client.close();
			client = null;
		}
		return super.disconnect();
	}
834609
def DropConnection(self, connection):
    """"""
    try:
      connection.cursor.close()
    except MySQLdb.Error:
      pass

    try:
      connection.dbh.close()
    except MySQLdb.Error:
      pass