Flushes all queued {@link Packet}s for all {@link Client}s except the one(s) specified.

@param <T> A {@link Client} or any of its children.
@param clients A variable amount of {@link Client}s to exclude from receiving the {@link Packet}.
547441
@SafeVarargs
    public final <T extends Client> void flushToAllExcept(T... clients) {
        writeHelper(Client::flush, clients);
    }
1359437
private void resetAllQueuesOrStreams(boolean clearStreams, @Nullable String prefix) {
    List<String> toRemove = Lists.newArrayListWithCapacity(queues.size());
    for (String queueName : queues.keySet()) {
      if ((clearStreams && QueueName.isStream(queueName)) || (!clearStreams && QueueName.isQueue(queueName))) {
        if (prefix == null ||  queueName.startsWith(prefix)) {
          toRemove.add(queueName);
        }
      }
    }
    for (String queueName : toRemove) {
      queues.remove(queueName);
    }
  }
201193
public void flush() throws IOException
    {
        super.flush();
        if (_complete&&!_completed)
        {
            _completed=true;

            _packet.resetData();
            _packet.addByte(AJP13ResponsePacket.__END_RESPONSE);
            _packet.addBoolean(_persistent);
            _packet.setDataSize();
            write(_packet);
            _packet.resetData();
        }
    }
550553
@Override
    public void flushBuffer() throws IOException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Flushing buffers: " + this);
        }
        if (null != this.outWriter) {
            this.outWriter.flush();
        } else {
            this.outStream.flush();
        }
    }
34235
private void updateClients() {
    assignedClients.addAll(newlyAssignedClients);
    assignedClients.removeAll(removedClients);
    
    newlyAssignedClients.clear();
    removedClients.clear();
  }
1162551
public final void writeAndFlushToAllExcept(Packet packet, Collection<? extends Client> clients) {
        writeHelper(packet::writeAndFlush, clients);
    }
954274
private static void __flush(InputStream is, OutputStream os, int bufferSize) throws IOException {
        byte[] buffer = new byte[bufferSize];

        for (int length = 0; (length = is.read(buffer)) > 0;) {
            os.write(buffer, 0, length);
        }
    }
1003920
public void clientDidLogoff (Client client)
    {
        if (nodeobj == null) {
            return;
        }
        String nodeName = getNodeName();
        for (ClientInfo clinfo : nodeobj.clients) {
            _peermgr.clientLoggedOff(nodeName, clinfo);
        }
        for (NodeObject.Lock lock : nodeobj.locks) {
            _peermgr.peerRemovedLock(nodeName, lock);
        }

        nodeobj.removeListener(_listener);

        _peermgr.disconnectedFromPeer(this);
        _listener = null;
        nodeobj = null;
    }
393227
private void flushBuffer(final ByteBuffer buffer, final DataOutput stream) throws IOException {
        buffer.flip();
        stream.write(buffer.array(), buffer.arrayOffset(), buffer.remaining());

        buffer.clear();
    }
43667
protected T removeClient(Server server) {
        T client = rxClientCache.remove(server);
        if (client != null) {
            client.shutdown();
        }
        return client;
    }
1285408
public void flushQueue() {
        /*
            Basically we just want to form GridOp and pass it to native executioner
            But since we don't have GridOp interface yet, we'll send everything to underlying CudaExecutioner.
         */
        //    logger.info("Non-Blocking flush");
        // TODO: proper implementation for GridOp creation required here
        /*
        Deque<OpDescriptor> currentQueue = deviceQueues.get();
        if (currentQueue == null)
            return;
        
        OpDescriptor op = currentQueue.pollFirst();
        while (op != null) {
            pushToGrid(op, false);
        
            op = currentQueue.pollFirst();
        }
        */

        // we need to check,
        OpDescriptor op = lastOp.get();
        if (op != null) {
            if (!experimental.get()) {
                //if (!nativeOps.isExperimentalEnabled()) {
                // it might be only pairwise transform here for now
                //          logger.info("Flushing existing lastOp");
                lastOp.remove();
                dequeueOp(op);
                pushToGrid(op, false);
            } else {
                throw new UnsupportedOperationException("Experimental flush isn't supported yet");
            }
        } else {
            //      logger.info("Queue is empty");

        }
    }
469472
private void onSuspend(final List<Address> members) {
        Message msg = null;
        Collection<Address> participantsInFlush = null;
      synchronized (sharedLock) {
         flushCoordinator = localAddress;         

         // start FLUSH only on group members that we need to flush
         participantsInFlush = members;
         participantsInFlush.retainAll(currentView.getMembers());
         flushMembers.clear();
         flushMembers.addAll(participantsInFlush);
         flushMembers.removeAll(suspected);
         
          msg = new Message(null).src(localAddress).setBuffer(marshal(participantsInFlush, null))
            .putHeader(this.id, new FlushHeader(FlushHeader.START_FLUSH, currentViewId()));

      }
        if (participantsInFlush.isEmpty()) {
            flush_promise.setResult(SUCCESS_START_FLUSH);
        } else {
            down_prot.down(msg);
            if (log.isDebugEnabled())
                log.debug(localAddress + ": flush coordinator "
                        + " is starting FLUSH with participants " + participantsInFlush);
        }
    }
1132878
public static void closeClient(TServiceClient client) {
        if (client == null) {
            return;
        }
        try {
            TProtocol proto = client.getInputProtocol();
            if (proto != null) {
                proto.getTransport().close();
            }
        } catch (Throwable e) {
            logger.warn("close input transport fail", e);
        }
        try {
            TProtocol proto = client.getOutputProtocol();
            if (proto != null) {
                proto.getTransport().close();
            }
        } catch (Throwable e) {
            logger.warn("close output transport fail", e);
        }

    }
196729
private final void flushBuffer()
        throws IOException
    {
        if (mOutputPtr > 0 && mOutputBuffer != null) {
            int ptr = mOutputPtr;
            // Need to update location info, to keep it in sync
            mLocPastChars += ptr;
            mLocRowStartOffset -= ptr;
            mOutputPtr = 0;
            mOut.write(mOutputBuffer, 0, ptr);
        }
    }
828038
public void flush() {
    for (Batch batch : batches.values()) {
      Collection<Batch> subbatches = batch.split();
      for (Batch miniBatch : subbatches) {
        threadPool.submit(miniBatch);
      }
    }
    batches.clear();
  }
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
1004242
public void cleanUp(RESTRequest request) {
        //We need to loop through the clients but we don't want to synchronize
        //the entire map, which would block new clients from entering and block existing 
        //clients from continuing their work.  So we iterate and possibly remove by just
        //using the built-in concurrency of ConcurrentHashMap.
        final Iterator<Entry<Integer, ClientNotificationArea>> clients = inboxes.entrySet().iterator();

        while (clients.hasNext()) {
            Entry<Integer, ClientNotificationArea> client = clients.next();

            //Check for time outs
            ClientNotificationArea inbox = client.getValue();
            if (inbox.timedOut()) {
                //cleanup
                inbox.cleanUp(request);

                //Emit the warning
                Tr.warning(tc, "jmx.connector.server.rest.notification.timeout.warning", client.getKey());

                //remove the client inbox from the map (using the Iterator.remove() method)
                clients.remove();
            }
        }

    }