shutdown a service server.
 @param [ServiceServer] service ServiceServer to be shutdown
160395
def shutdown_service_server(service)
      begin
        @master.unregister_service(service.service_name,
                                   service.service_uri)
        @service_servers.delete(service) do |pub|
          raise "service_server not found"
        end
      ensure
        service.close
      end
    end
937179
def shutdown_mp(self, clean=True):
        
        # The server runs on a worker thread, so we need to shut it down first.
        if hasattr(self, 'server'):
            # Shutdown the server quickly.
            try:
                # For some strange reason, this throws an OSError on windows.
                self.server.socket.shutdown(socket.SHUT_RDWR)
            except OSError:
                pass
            self.server.socket.close()
            self.server.shutdown()
        if hasattr(self, 'handler'):
            self.handler.workers.stop_workers(clean)
481068
protected void destroyEurekaServerContext() throws Exception {
		EurekaMonitors.shutdown();
		if (this.awsBinder != null) {
			this.awsBinder.shutdown();
		}
		if (this.serverContext != null) {
			this.serverContext.shutdown();
		}
	}
171085
public synchronized void shutdown() {
        if (stopLock.get())
            return;


        // shutting down underlying transport
        transport.shutdown();

        // disposing INDArray flow
        disposable.dispose();

        updaterParamsSubscribers.clear();
        modelParamsSubsribers.clear();
        updatesSubscribers.clear();
        updatesQueue.clear();

        // state that we're done
        launchLock.set(false);

        stopLock.set(true);
    }
727005
public void close() {
        for (KSISigningService service : subservices) {
            try {
                service.close();
            } catch (IOException e) {
                logger.error("Failed to close subservice", e);
            }
        }
    }
404776
public void stopServer() {
        if (this.jmxConnectorServer == null) {
            this.logger.info("No JMXConnectorServer to stop");
            return;
        }

        try {
            try {
                this.jmxConnectorServer.stop();
                this.logger.info("Stopped JMXConnectorServer");
            } catch (IOException ioe) {
                throw new IllegalStateException("Failed to stop the JMXConnectorServer", ioe);
            }

            this.jmxConnectorServer = null;
        } catch (RuntimeException re) {
            if (this.failOnException) {
                throw re;
            }

            this.logger.error("Failed to shutdown the JMX Server", re);
        }
    }
916847
def api_stop(server_state):
    
    api_srv = server_state['api']

    if api_srv is not None:
        log.info("Shutting down API")
        api_srv.stop_server()
        api_srv.join()
        log.info("API server joined")
    else:
        log.info("API already joined")

    server_state['api'] = None
1334094
public void shutdown() {
        debugConnection = null;
        shuttingDown = true;
        try {
            if (serverSocket != null) {
                serverSocket.close();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
472235
def shutdown(self, service_thread_map):
    """"""
    with self._services.lifecycle_lock:
      for service, service_thread in service_thread_map.items():
        self._logger.info('terminating pantsd service: {}'.format(service))
        service.terminate()
        service_thread.join(self.JOIN_TIMEOUT_SECONDS)
      self._logger.info('terminating pantsd')
      self._kill_switch.set()
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()
225392
async def on_shutdown(self):
        
        await self._unregister_subscriptions()

        self._accepting = False

        for (ws, _) in self._subscribers:
            await ws.close(code=aiohttp.WSCloseCode.GOING_AWAY,
                           message='Server shutdown')
150112
def close(self):
        
        logger.info("Stop server")
        self.stopped.set()
        for event in self.to_be_stopped:
            event.set()
        self._socket.close()
1286451
async def on_shutdown(self, app):
        
        for ws in self.clients.copy():
            await ws.close(code=WSCloseCode.GOING_AWAY,
                           message='Server shutdown')
        self.shutdown()
1060398
def _destroy_server(self, server_name):
        """"""
        try:
            del self.servers[server_name]
        except KeyError:
            pass

        if self.auto_close and not self.servers:
            loop.stop()
1206726
@Override
  public void shutdown(DeployService2Impl<I> deploy,
                       ShutdownModeAmp mode,
                       Result<Boolean> result)
  {
    deploy.shutdownImpl(mode, result);
  }
570169
def stop
      server = Communist.servers.delete(app.object_id) { |s| NullServer.new }
      if Communist.server.respond_to?(:shutdown)
        server.shutdown
      elsif Communist.server.respond_to?(:stop!)
        server.stop!
      else
        server.stop
      end
      @server_thread.join
    end
71945
@Override
    public void shutdown() {
        final WireMockServer server = this;
        Thread shutdownThread = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    // We have to sleep briefly to finish serving the shutdown request before stopping the server, as
                    // there's no support in Jetty for shutting down after the current request.
                    // See http://stackoverflow.com/questions/4650713
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                server.stop();
            }
        });
        shutdownThread.start();
    }