make the cxf ClientImpl.close works, and we should close all clients too
11435
@Override
    public void close() {
        if (closed.compareAndSet(false, true)) {
            super.close();
            synchronized (baseClients) {
                for (WebClient wc : baseClients) {
                    wc.close();
                }
            }

            String moduleName = getModuleName();
            synchronized (clientsPerModule) {
                List<JAXRSClientImpl> clients = clientsPerModule.get(moduleName);

                if (clients != null) { // the only way this isn't null is if the same client was closed twice
                    clients.remove(this);
                    if (clients.isEmpty()) {
                        for (String id : busCache.keySet()) {
                            if (id.startsWith(moduleName) || id.startsWith("unknown:")) {
                                busCache.remove(id).shutdown(false);
                            }
                        }
                        clientsPerModule.remove(moduleName);
                    }
                }
            }

            baseClients = null;
        }
    }
370687
@Override
    public void close() throws InterruptedException {
        if (m_blessedThreadIds.contains(Thread.currentThread().getId())) {
            throw new RuntimeException("Can't invoke backpressureBarrier from within the client callback thread " +
                    " without deadlocking the client library");
        }
        m_isShutdown = true;
        synchronized (m_backpressureLock) {
            m_backpressureLock.notifyAll();
        }

        if (m_reconnectStatusListener != null) {
            m_distributer.removeClientStatusListener(m_reconnectStatusListener);
            m_reconnectStatusListener.close();
        }

        if (m_ex != null) {
            m_ex.shutdown();
            if (CoreUtils.isJunitTest()) {
                m_ex.awaitTermination(1, TimeUnit.SECONDS);
            } else {
                m_ex.awaitTermination(365, TimeUnit.DAYS);
            }
        }
        m_distributer.shutdown();
        ClientFactory.decreaseClientNum();
    }
1176379
@Override
  public void close() throws Exception {

    if (this.lookupClient != null) {
      this.lookupClient.close();
    }

    if (this.registryClient != null) {
      this.registryClient.close();
    }

    if (this.transport != null) {
      this.transport.close();
    }
  }
926145
public void close() throws IOException {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Closing client for session: 0x"
                    + Long.toHexString(getSessionId()));
        }

        try {
            RequestHeader h = new RequestHeader();
            h.setType(ZooDefs.OpCode.closeSession);

            submitRequest(h, null, null, null);
        } catch (InterruptedException e) {
            // ignore, close the send/event threads
        } finally {
            disconnect();
        }
    }
1307157
private void releaseClientReference(final Entry<K, V> entry) {
    Preconditions.checkNotNull(entry);
    boolean isExclusiveAdded;
    CloseableReference<V> oldRefToClose;
    synchronized (this) {
      decreaseClientCount(entry);
      isExclusiveAdded = maybeAddToExclusives(entry);
      oldRefToClose = referenceToClose(entry);
    }
    CloseableReference.closeSafely(oldRefToClose);
    maybeNotifyExclusiveEntryInsertion(isExclusiveAdded ? entry : null);
    maybeUpdateCacheParams();
    maybeEvictEntries();
  }
1037775
public void close(final AVIMClientCallback callback) {
    final AVIMClientCallback internalCallback = new AVIMClientCallback() {
      @Override
      public void done(AVIMClient client, AVIMException e) {
        if (null == e) {
          AVIMClient.this.localClose();
        }
        if (null != callback) {
          callback.done(client, e);
        }
      }
    };
    InternalConfiguration.getOperationTube().closeClient(this.clientId, internalCallback);
  }
890340
void close(ClientSocket stream)
  {
    if (log.isLoggable(Level.FINER))
      log.finer("close " + stream);

    _activeCount.decrementAndGet();
  }
871949
public void close() throws SFException, SnowflakeSQLException
  {
    logger.debug(" public void close()");

    // stop heartbeat for this session
    stopHeartbeatForThisSession();

    if (isClosed)
    {
      return;
    }

    SessionUtil.LoginInput loginInput = new SessionUtil.LoginInput();
    loginInput.setServerUrl(
        (String) connectionPropertiesMap.get(SFSessionProperty.SERVER_URL))
        .setSessionToken(sessionToken)
        .setLoginTimeout(loginTimeout);

    SessionUtil.closeSession(loginInput);
    closeTelemetryClient();
    clientInfo.clear();
    isClosed = true;
  }
1024393
@Beta(SinceVersion.V1_1_0)
    public void close() {
        httpClient.dispatcher().executorService().shutdown();
        httpClient.connectionPool().evictAll();
        synchronized (httpClient.connectionPool()) {
            httpClient.connectionPool().notifyAll();
        }
        synchronized (AsyncTimeout.class) {
            AsyncTimeout.class.notifyAll();
        }
    }
1257404
@Override
  public void close()
  {
    ServiceManagerClient client = _client;
    _client = null;
    
    if (client != null) {
      client.close();
    }
  }
60017
def close(self):
        

        def validate_client(client):
            """
            Validate that the connection is for the current client
            :param client:
            :return:
            """
            host, port = client.addr
            parsed_url = urlparse(self._hostname)
            return host == parsed_url.hostname and port == parsed_url.port

        # read https://github.com/twisted/treq/issues/86
        # to understand the following...
        def _check_fds(_):
            fds = set(reactor.getReaders() + reactor.getReaders())
            if not [fd for fd in fds if isinstance(fd, Client) and validate_client(fd)]:
                return

            return deferLater(reactor, 0, _check_fds, None)

        pool = self._async_http_client_params["pool"]
        return pool.closeCachedConnections().addBoth(_check_fds)
4546
void stopAll() {

		try {
			this.dmClient.closeConnection();
			stop();

		} catch( Throwable t ) {
			this.logger.warning( "An error occurred while closing the connection of the DM client." );
			Utils.logException( this.logger, new RuntimeException( t ));
		}
	}
176087
def _close_brokerclients(self, clients):
        
        def _log_close_failure(failure, brokerclient):
            log.debug(
                'BrokerClient: %s close result: %s: %s', brokerclient,
                failure.type.__name__, failure.getErrorMessage())

        def _clean_close_dlist(result, close_dlist):
            # If there aren't any other outstanding closings going on, then
            # close_dlist == self.close_dlist, and we can reset it.
            if close_dlist == self.close_dlist:
                self.close_dlist = None

        if not self.close_dlist:
            dList = []
        else:
            log.debug("%r: _close_brokerclients has nested deferredlist: %r",
                      self, self.close_dlist)
            dList = [self.close_dlist]
        for brokerClient in clients:
            log.debug("Calling close on: %r", brokerClient)
            d = brokerClient.close().addErrback(_log_close_failure, brokerClient)
            dList.append(d)
        self.close_dlist = DeferredList(dList)
        self.close_dlist.addBoth(_clean_close_dlist, self.close_dlist)
982176
def close(self):
        
        self.sasl.mechanism.destroy()
        self.sasl_client.get_client().destroy()
        self._underlying_xio.destroy()
746172
def release_client(self, cb):
        
        if cb:
            self._q.put(cb, True)
            self._clients_in_use -= 1
958665
public void closeAll() {
		for (Object connection : pool.values()) {
			JMXMonConnection jmxcon = (JMXMonConnection)connection;
            if (jmxcon.connector != null) {
                try {
                	jmxcon.connector.close();
                    log.debug("jmx connector is closed");
                } catch (Exception ex) {
                    log.debug("Can't close jmx connector, but continue");
                }
            } else {
                log.debug("jmxConnector == null, don't try to close connection");
            }
            
            jmxcon.connector = null;
            jmxcon = null;
            
        }
		/* erase pool informations for this run but will be recreate for the next run */
		pool.clear();
	}
220403
public synchronized void close() throws IOException, InterruptedException {
		if (isClosed){
			return;
		}
		
		logger.info("closing client endpoint");
		if (connState == CONN_STATE_CONNECTED) {
			idPriv.disconnect();
			this.wait(1000);
		}
		if (connState >= CONN_STATE_RESOURCES_ALLOCATED) {
			idPriv.destroyQP();
		}
		idPriv.destroyId();
		group.unregisterClientEp(this);
		isClosed = true;
		logger.info("closing client done");
	}