Closes (terminates) all of its clients. Though keeps server running.
767161
def _handle_sighup(myrpcserver, signum, unused):
    """"""
    print("SIGHUP: stopping all clients",sys.stderr)
    if myrpcserver._closed:
        return
    for c in set(myrpcserver.clients):
        try:
            c.shutdown(socket.SHUT_RDWR)
        except Exception:
            pass
        c.close()
    myrpcserver.clients.clear()
526768
@Override
  public void stop() throws Exception {
    mStopped = true;
    if (mServerSocket != null) {
      try {
        mServerSocket.close();
      } catch (IOException e) {
        LOG.warn("Exception in closing server socket: {}", e);
      }
    }
    mThreadPool.shutdownNow();
    // Close all client sockets so that their serving threads can stop. We shut down the threadpool
    // before closing the sockets so that no new socket threads will be created after we try to
    // close them all.
    synchronized (mClientSockets) {
      for (Socket socket : mClientSockets) {
        try {
          socket.close();
        } catch (IOException e) {
          LOG.warn("Exception in closing client socket: {}", e);
        }
      }
    }
    boolean ret = mThreadPool.awaitTermination(THREAD_KEEP_ALIVE_TIME_MS, TimeUnit.MILLISECONDS);
    if (ret) {
      LOG.info("All worker threads have terminated.");
    } else {
      LOG.warn("Log server has timed out waiting for worker threads to terminate.");
    }
  }
1307212
@FFDCIgnore(value = { InterruptedException.class })
    public void close() {
        // remove all the clients from the deque, closing them as we go
        while (numClientsClosed.get() < numClients) {
            try {
                Client client = clients.takeFirst();
                try {
                    client.close();
                } catch (Exception e) {
                    //Ignore this
                }
                numClientsClosed.incrementAndGet();

                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                    Tr.event(tc, "pool closed   - " + numClientsClosed + " of " + numClients + " clients closed");
            } catch (InterruptedException e) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                    Tr.event(tc, "InterruptedException during close - will retry");
            }
        }
    }
559166
protected synchronized void quit() {
        log.debug("Stopping {}", getName());
        closeServerSocket();

        // Close all handlers. Handler threads terminate if run loop exits
        synchronized (handlers) {
            for (ProtocolHandler handler : handlers) {
                handler.close();
            }
            handlers.clear();
        }
        log.debug("Stopped {}", getName());
    }
919830
def terminate(self):
        """"""
        logger.info("deleting entire server %s" % self)
        self.close()
        try:
            shutil.rmtree(self.basedir)
            logger.info("deleted server under %s" % self.basedir)
            # delete everything from self, so that using this object fails results
            # in an error as quickly as possible
            for val in self.__dict__.keys():
                try:
                    delattr(self, val)
                except:
                    pass
        except Exception, e:
            logger.warning("failed to delete SessionServer: %s" % (e))
1231484
public void close() {
        boolean isPreviouslyClosed = isClosed.getAndSet(true);
        if (isPreviouslyClosed) {
            return;
        }

        AdminClient client;
        while ((client = clientCache.poll()) != null) {
            client.close();
        }
    }
677720
def close(self):
        
        gevent.killall(self._tasks, block=True)
        self._tasks = []
        self._ssh.close()
1233781
public synchronized void close() throws IOException {
        if(getStatus().equals(ConnectionStatus.CLOSED)){
            return ;
        }
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Closing client for session: 0x"
                      + getSessionId());
        }
        connectRun.set(false);

        try{
            clientSocket.cleanup();
        }catch(Exception e){
            LOGGER.warn("Close the WSDirectorySocket get error.", e);
        }

        try {
            setStatus(ConnectionStatus.CLOSED);
            sendCloseSession();
            closeSession();
            eventThread.queueEventOfDeath();
        } catch (ServiceException e) {
            LOGGER.warn("Execute the CloseSession Protocol failed when close", e);
        }
    }
436290
def stop(self):
        
        self.debug("()")
        super(SensorServer, self).stop()
        # No new clients
        if self._multicast_socket is not None:
            self._shutdown_multicast_socket()
        # Signal packet loop to shutdown
        self._is_stopped.set()
1301733
public void quit() {
        try {
            this.keepOn = false;
            if (this.serverSocket != null && !this.serverSocket.isClosed()) {
                this.serverSocket.close();
                this.serverSocket = null;
            }
        } catch (final IOException e) {
            throw new RuntimeException(e);
        }
    }
699664
def stop(self):
        
        if self.is_run:
            self._service.shutdown()
            self._service.server_close()
563968
def close(self):
        
        if self._publish:
            self._events.put((self._listener.publish_server_closed,
                              (self._description.address, self._topology_id)))
        self._monitor.close()
        self._pool.reset()
774728
def close(self):
        
        self.application.client_leaving(self)

        self.conn.close()
        self.closed = True
796659
def close(self):
        
        if not self._closed:
            self._closed = True
            self._stop_multi_pools()
            if self._http_pool is not None:
                self._http_pool.clear()
                self._http_pool = None
            if self._tcp_pool is not None:
                self._tcp_pool.clear()
                self._tcp_pool = None
834046
def close(self) -> None:
        """"""
        if not self._closed:
            self._async_client.close()
            self._io_loop.close()
            self._closed = True
32022
protected void dispose() {
        // Terminates the server thread
        if(serverThread != null) {
            serverThread.interrupt();
            serverThread = null;
        }

        // Stops each connection and clears them
        synchronized(connections) {
            for(FTPConnection con : connections) {
                try {
                    con.stop(true);
                } catch(Exception ex) {
                    ex.printStackTrace();
                }
            }
            connections.clear();
        }
    }
1071290
def server_close(self):
        
        if self.remove_file:
            try:
                os.remove(self.remove_file)
            except:
                pass
        self.socket.close()