Stop the server. Once stopped, a server cannot be used again.
764103
public void stop() {
    if (httpHandler != null) {
      httpHandler.shutdown();
    }
    if (server != null) {
      ServerTools.print("Stopping server...");
      server.stop(5);
      isRunning = false;
      ServerTools.print("Server stopped");
    }
  }
1235198
def stop_and_destroy(self, sync=True):
        
        def _self_destruct():
            """destroy the server and all storages attached to it."""

            # try_it_n_times util is used as a convenience because
            # Servers and Storages can fluctuate between "maintenance" and their
            # original state due to several different reasons especially when
            # destroying infrastructure.

            # first destroy server
            try_it_n_times(operation=self.destroy,
                           expected_error_codes=['SERVER_STATE_ILLEGAL'],
                           custom_error='destroying server failed')

            # storages may be deleted instantly after server DELETE
            for storage in self.storage_devices:
                try_it_n_times(operation=storage.destroy,
                               expected_error_codes=['STORAGE_STATE_ILLEGAL'],
                               custom_error='destroying storage failed')

        if sync:
            self.populate()

        # server is either starting or stopping (or error)
        if self.state in ['maintenance', 'error']:
            self._wait_for_state_change(['stopped', 'started'])

        if self.state == 'started':
            try_it_n_times(operation=self.stop,
                           expected_error_codes=['SERVER_STATE_ILLEGAL'],
                           custom_error='stopping server failed')

            self._wait_for_state_change(['stopped'])

        if self.state == 'stopped':
            _self_destruct()
        else:
            raise Exception('unknown server state: ' + self.state)
630500
@Write(consumes = {})
    public Object stop() {
        try {
            return message;
        } finally {
            Thread thread = new Thread(this::stopServer);
            thread.setContextClassLoader(getClass().getClassLoader());
            thread.start();
        }
    }
19373
async def stop(self, **kwargs):
        """"""
        _LOGGER.debug('Shutting down pairing server')
        if self._web_server is not None:
            await self._web_server.shutdown()
            self._server.close()

        if self._server is not None:
            await self._server.wait_closed()
641536
public void stop() throws IOException {
		synchronized (this.monitor) {
			if (this.serverThread != null) {
				this.serverThread.close();
				try {
					this.serverThread.join(2000);
				}
				catch (InterruptedException ex) {
					Thread.currentThread().interrupt();
				}
				this.serverThread = null;
			}
		}
	}
965190
def stop(name, call=None):
    '''
    
    '''
    datacenter_id = get_datacenter_id()
    conn = get_conn()
    node = get_node(conn, name)

    conn.stop_server(datacenter_id=datacenter_id, server_id=node['id'])

    return True
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
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);
        }
    }
339257
function stop() {
  return new Promise((resolve) => {
    if (child && child.kill) {
      debug('stopping test server');
      child.kill('SIGTERM');
      process.removeListener('exit', stop);
      child = null;
      debug('stopped test server');
    }

    resolve();
  });
}
1109768
public void stop() throws IOException {
		synchronized (this.monitor) {
			if (this.listenThread != null) {
				closeAllConnections();
				try {
					this.executor.shutdown();
					this.executor.awaitTermination(1, TimeUnit.MINUTES);
				}
				catch (InterruptedException ex) {
					Thread.currentThread().interrupt();
				}
				this.serverSocket.close();
				try {
					this.listenThread.join();
				}
				catch (InterruptedException ex) {
					Thread.currentThread().interrupt();
				}
				this.listenThread = null;
				this.serverSocket = null;
			}
		}
	}
1207789
public void stop() throws Exception {
        DruidIndices.getInstance().remove(String.valueOf(port));
        server.stop();
    }
1142841
def stop(self):
        
        if self.server.eio.async_mode == 'threading':
            func = flask.request.environ.get('werkzeug.server.shutdown')
            if func:
                func()
            else:
                raise RuntimeError('Cannot stop unknown web server')
        elif self.server.eio.async_mode == 'eventlet':
            raise SystemExit
        elif self.server.eio.async_mode == 'gevent':
            self.wsgi_server.stop()
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();
    }
  }
1218544
def stop(self):
        
        if self._wrapper_telnet_server:
            self._wrapper_telnet_server.close()
            yield from self._wrapper_telnet_server.wait_closed()
        self.status = "stopped"
159564
def end(self):
        """"""
        if not self.args.disable_autodiscover:
            self.autodiscover_client.close()
        self.server.end()
162441
public void stop() {
        if (kafkaServer != null) {
            try {
                if (kafkaServer.brokerState().currentState() != (NotRunning.state())) {
                    kafkaServer.shutdown();
                    kafkaServer.awaitShutdown();
                }
            } catch (Exception e) {
                log.warn("Failed to shutdown Kafka embedded server", e);
            }

            try {
                CoreUtils.delete(kafkaServer.config().logDirs());
            } catch (Exception e) {
                log.warn("Failed to remove logs on Kafka embedded server", e);
            }
        }

        if (serverFactory != null) {
            try {
                serverFactory.shutdown();
            } catch (Exception e) {
                log.warn("Failed to shutdown Zookeeper instance", e);
            }
        }
    }
764034
async def close(self):
        
        if self._server:
            self._server.close()
            self._server = None
            self.event('stop').fire()