Close the given broker clients.

        :param clients: Iterable of `_KafkaBrokerClient`
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)
1146642
def close(self, suppress_logging=False):
        
        pool_names = list(self.pools)
        for name in pool_names:
            self._close(name, suppress_logging)
1107386
async def close(self):
        
        if self.is_closed():
            return

        self._closed = True

        for vc in self.voice_clients:
            try:
                await vc.disconnect()
            except Exception:
                pass

        to_close = [shard.ws.close() for shard in self.shards.values()]
        if to_close:
            await asyncio.wait(to_close, loop=self.loop)

        await self.http.close()
774728
def close(self):
        
        self.application.client_leaving(self)

        self.conn.close()
        self.closed = True
1350917
def delete_client(client_id, preserve_cache):
    
    if client_id in drivers:
        drivers.pop(client_id).quit()
        try:
            timers[client_id].stop()
            timers[client_id] = None
            release_semaphore(client_id)
            semaphores[client_id] = None
        except:
            pass

    if not preserve_cache:
        pth = CHROME_CACHE_PATH + g.client_id
        shutil.rmtree(pth)
1004253
def close(self, **kwargs):
        
        self.scale_down(self.cluster.scheduler.workers)
        return self.cluster.close(**kwargs)
1234067
private void closeOutgoingSockets() throws ClientException {

        SocketOperator op = new SocketOperator() {
                public void operate(SocketBox sb) throws Exception {
                    if (((ManagedSocketBox) sb).isReusable()) {
                        Socket s = sb.getSocket();
                        if (s != null) {
                            // write the closing Eblock and close the socket
                            EBlockImageDCWriter.close(
                                  new DataOutputStream(s.getOutputStream()));
                        }
                    }
                }
       };

        try {
            socketPool.applyToAll(op);
        } catch (IOException e) {
            // ignore - sometimes server might close the socket
        } catch (Exception e) {
            ClientException ce =
                new ClientException(ClientException.SOCKET_OP_FAILED);
            ce.setRootCause(e);
            throw ce;
        }
    }
1276296
private synchronized void closeIdleClients() {
        List<Client> candidates = new LinkedList<Client>(openClients.values());
        logger.debug("Scanning for idle clients; " + candidates.size() + " candidates.");
        for (Client client : candidates) {
            if ((useCounts.get(client) < 1) &&
                    ((timestamps.get(client) + idleLimit.get() * 1000) <= System.currentTimeMillis())) {
                logger.debug("Idle time reached for unused client {}", client);
                closeClient(client);
            }
        }
    }
1231484
public void close() {
        boolean isPreviouslyClosed = isClosed.getAndSet(true);
        if (isPreviouslyClosed) {
            return;
        }

        AdminClient client;
        while ((client = clientCache.poll()) != null) {
            client.close();
        }
    }
803389
def client_end_all():
    
    for request, socket, context in CLIENTS.values()[:]:
        client_end(request, socket, context)
103493
async def clean_up_clients_async(self):
        
        if self.partition_receiver:
            if self.eh_client:
                await self.eh_client.stop_async()
                self.partition_receiver = None
                self.partition_receive_handler = None
                self.eh_client = None
511012
def close_http_client(reason)
      @http_client.close(reason) if @http_client
      true
    rescue StandardError => e
      ErrorTracker.log(self, "Failed closing connection", e)
      false
    end
391269
def _broker_exit(self):
        
        for _, (side, _) in self.poller.readers + self.poller.writers:
            LOG.debug('_broker_main() force disconnecting %r', side)
            side.stream.on_disconnect(self)

        self.poller.close()
373642
@Override
    public void clientDestroyed(Client client) {
        if (AGENT_PORT_TYPE.equals(getEndpointName(client.getEndpoint()))) {
            return;
        }
        processStop(client.getEndpoint(), EventTypeEnum.CLIENT_DESTROY);
    }
916884
public final void writeAndFlush(Collection<? extends Client> clients) {
        if (clients.isEmpty()) {
            throw new IllegalArgumentException("You must send this packet to at least one client!");
        }

        clients.forEach(this::writeAndFlush);
    }
1002884
public void closeConsumers()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "closeConsumers");

    //This must be a rme
    for(Iterator i=_anycastInputHandlers.keySet().iterator(); i.hasNext(); )
    {
      AnycastInputHandler next = _anycastInputHandlers.get(i.next());
      ConsumerDispatcher rcd = next.getRCD();
      
      rcd.closeAllConsumersForDelete(_baseDestinationHandler);
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "closeConsumers");

    return;
  }
280821
private synchronized void closeAllAcceptedSockets() {
    for (int x = 0; x < socketList.size(); x++) {
      try {
        ((Socket) socketList.get(x)).close();
      } catch (Exception e) {
        // ignore for now
      }
    }

    // clear member variables
    socketMap.clear();
    socketList.clear();
  }