Shut down the HTTP server and all its workers, and close the listener socket.
543624
public void stopServer() {
        shouldRun = false;
        try {
            listener.close();
        } catch (IOException ex) {
            // Don't care
        }
        while (true) {
            synchronized (allWorkers) {
                if (allWorkers.isEmpty()) {
                    break;
                }
                for (Worker w : allWorkers) {
                    w.stopSocket();
                    w.interrupt();
                }
            }
        }

        try {
            listener.close();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }
522072
public function stop()
    {
        $this->stopWorkerPools();
        $this->workerJobSocket->disconnect($this->config['sockets']['worker_job']);
        $this->workerReplySocket->close();
        $this->clientSocket->close();
        $this->loop->stop();
    }
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()
1233190
def close(self):
        
        keys = set(self._conns.keys())
        for key in keys:
            self.stop_socket(key)

        self._conns = {}
595276
function shutdown() {
  ee.emitAsync('shutdown_server')
    .then(() => ee.emitAsync('shutdown_service'))
    .then(() => {
      ee.emit('shutted_down');
    })
    .catch((err) => {
      ee.emit('error', err); // TODO [ERR2BTERR] Maybe err -> BootError(err)
    });
}
1274830
def server_close(self):
        
        self.log.debug("Closing the socket server connection.")
        TCPServer.server_close(self)
        self.queue_manager.close()
        self.topic_manager.close()
        if hasattr(self.authenticator, 'close'):
            self.authenticator.close()
        self.shutdown()
375344
def teardown_socket(s):
  """"""
  try:
    s.shutdown(socket.SHUT_WR)
  except socket.error:
    pass
  finally:
    s.close()
1031828
def close(self):
        """"""
        try:
            self._socket.sendall('quit\r\n')
        except socket.error:
            pass
        try:
            self._socket.close()
        except socket.error:
            pass
307269
def close(self):
        
        if self._server is None:
            raise RuntimeError('Server is not started')
        self._server.close()
        for handler in self._handlers:
            handler.close()
604013
private function shutDownEverything()
    {
        foreach ($this->clients as $client) {
            $this->disconnect($client);
        }
        $this->masterSocket->close();
        unset(
            $this->hooks,
            $this->address,
            $this->port,
            $this->timeout,
            $this->domain,
            $this->masterSocket,
            $this->maxClients,
            $this->maxRead,
            $this->clients,
            $this->readType
        );
    }
298333
public void stop() {
    if (stopRequested)
      return;
    stopRequested = true;
    LOG.info("Stopping http server");
    try {
      if (httpServer != null) httpServer.stop();
    } catch (Exception e) {
      LOG.error(StringUtils.stringifyException(e));
    }

    LOG.info("Stopping namesystem");
    if(namesystem != null) namesystem.close();

    LOG.info("Stopping emptier");
    if(emptier != null) emptier.interrupt();

    LOG.info("Stopping rpc servers");
    if(server != null) server.stop();
    if (dnProtocolServer != null) dnProtocolServer.stop();

    LOG.info("Stopping metrics");
    if (myMetrics != null) {
      myMetrics.shutdown();
    }

    LOG.info("Stopping namesystem mbeans");
    if (namesystem != null) {
      namesystem.shutdown();
    }
  }
895934
function stop(callback) {
    if (httpServer) {
        DEBUG && debug('stop http server');
        try {
            httpServer.close();
        } catch (e) {
        }
        httpServer = null;
    } else {
        DEBUG && debug('***ignore*** http server is not running!');
    }
    callback && callback(false);
}
721592
def shutdown(self):
        

        # Remove ourself from the dictionary of running managers
        try:
            del self._running_managers[self._manager_key]
        except KeyError:
            pass

        # Kill the listening thread
        self._listen_thread.kill()

        # Close all the connections
        for conn in self.tendrils.values():
            conn.close()

        # Ensure all data is appropriately reset
        self.tendrils = {}
        self.running = False
        self._local_addr = None
        self._local_addr_event.clear()
        self._listen_thread = None
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());
    }
1075347
public void stopServer()
    {
        Log(Level.INFO, "Attempting to stop SocketServer");
        keepRunning = false;
        // Thread will be blocked waiting for input - unblock it by closing the socket underneath it:
        if (this.serverSocket != null)
        {
            try
            {
                this.serverSocket.close();
            }
            catch (IOException e)
            {
                Log(Level.WARNING, "Something happened when closing SocketServer: " + e);
            }
            this.serverSocket = null;
        }
    }
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()
860539
protected void stopAndReleaseGrpcServer() {
        factory.destroy();
        Server localServer = this.server;
        if (localServer != null) {
            localServer.shutdown();
            this.server = null;
            log.info("gRPC server shutdown.");
        }
    }