停止server
@access protected
@return void
337255
protected function stop()
    {
        $pid = $this->getMasterPid();

        if (!$this->isRunning($pid)) {
            $this->output->writeln('<error>no swoole http server process running.</error>');
            return;
        }

        $this->output->writeln('Stopping swoole http server...');

        $isRunning = $this->killProcess($pid, SIGTERM, 15);

        if ($isRunning) {
            $this->output->error('Unable to stop the swoole_http_server process.');
            return;
        }

        $this->removePid();

        $this->output->writeln('> success');
    }
758308
public function close()
    {
        $this->setError('');
        $this->server_caps = null;
        $this->helo_rply = null;
        if (is_resource($this->smtp_conn)) {
            // close the connection and cleanup
            fclose($this->smtp_conn);
            $this->smtp_conn = null; //Makes for cleaner serialization
            $this->edebug('Connection: closed', self::DEBUG_CONNECTION);
        }
    }
435168
public function stop()
    {
        $this->shutdown = true;
        if($this->getProcess()->getPid() == getmypid()) {
            $this->getLogger()->notice('Worker {worker} shutting down', array('worker' => $this));
        }else{
            $this->getProcess()->kill(SIGQUIT);
        }
    }
648086
public void stop() {
		if (serverThread != null) {
			try {
				//close and force IOException in server process
				server.close();
				//server thread will end as well
			} catch (IOException ioe) {
				System.out.println(new LogEntry(Level.CRITICAL, ioe.getMessage(), ioe));
			}
		}

		//close client connections as well
		for (Connection client : new HashSet<Connection>(connectedClients)) {
			if (!client.isClosed()) {
				client.close("server shut down...");
			}
		}
	}
232118
final public function shutdown() : void
    {
        $this->__call('shutdown');
        Master::wait($this->backend->process()->pid ?? -2);
    }
713604
public function destroy()
    {
        if ($this->_hasSession() && !$this->started()) {
            $this->start();
        }

        if (!$this->_isCLI && session_status() === \PHP_SESSION_ACTIVE) {
            session_destroy();
        }

        $_SESSION = [];
        $this->_started = false;
    }
1167773
public function shutdown()
    {
        // Prevent user abort allowing onShutdown event to run without interruptions.
        if (\function_exists('ignore_user_abort')) {
            @ignore_user_abort(true);
        }

        // Close the session allowing new requests to be handled.
        if (isset($this['session'])) {
            $this['session']->close();
        }

        if ($this['config']->get('system.debugger.shutdown.close_connection', true)) {
            // Flush the response and close the connection to allow time consuming tasks to be performed without leaving
            // the connection to the client open. This will make page loads to feel much faster.

            // FastCGI allows us to flush all response data to the client and finish the request.
            $success = \function_exists('fastcgi_finish_request') ? @fastcgi_finish_request() : false;

            if (!$success) {
                // Unfortunately without FastCGI there is no way to force close the connection.
                // We need to ask browser to close the connection for us.
                if ($this['config']->get('system.cache.gzip')) {
                    // Flush gzhandler buffer if gzip setting was enabled.
                    ob_end_flush();

                } else {
                    // Without gzip we have no other choice than to prevent server from compressing the output.
                    // This action turns off mod_deflate which would prevent us from closing the connection.
                    if ($this['config']->get('system.cache.allow_webserver_gzip')) {
                        header('Content-Encoding: identity');
                    } else {
                        header('Content-Encoding: none');
                    }

                }


                // Get length and close the connection.
                header('Content-Length: ' . ob_get_length());
                header('Connection: close');

                ob_end_flush();
                @ob_flush();
                flush();
            }
        }

        // Run any time consuming tasks.
        $this->fireEvent('onShutdown');
    }
79871
public function stop()
    {
        $options = static::getOptions();
        $debug = @$options['debug'] === true;

        $pidFile = $options['pid_file'];
        if (!$pidFile)
            throw new \Exception("No pid_file in the config");

        $fpPid = fopen($pidFile, "c");
        if (!$fpPid)
            throw new \Exception("Could not open " . $pidFile);

        if (flock($fpPid, LOCK_EX | LOCK_NB)) {
            flock($fpPid, LOCK_UN);
            fclose($fpPid);
            if ($debug)
                echo "==> Daemon not running" . PHP_EOL;
            return;
        }

        fclose($fpPid);
        $pid = (int)file_get_contents($pidFile);
        if ($debug)
            echo "==> Killing the daemon (PID $pid)..." . PHP_EOL;

        posix_kill($pid, SIGTERM);
        pcntl_waitpid($pid, $status);
    }
876905
@Override
  public void stop() {
    logger().log("Server stopping...");

    failTimedOutMissingContentRequests();

    channel.stop();
    channel.close();

    for (final Dispatcher dispatcher : dispatcherPool) {
      dispatcher.stop();
    }

    logger().log("Server stopped.");

    super.stop();
  }
347504
public function stop($instance = 'current')
    {
        // Get (current or old) service info
        if ($serviceInfo = $this->getServiceInfo($instance)) {
            list($pid, $managerPid, $port) = array_values($serviceInfo);
            // Get serving connection numbers
            $connections = $this->sendCommand('connections', $port, $error);

            // Wait while all connections are served
            // @codeCoverageIgnoreStart
            while (!$error && $connections > 0) {
                usleep(5e5);
                $connections = $this->sendCommand('connections', $port, $error);
            }
            // @codeCoverageIgnoreEnd

            // Send TERM signal to master process to stop service
            posix_kill($pid, SIGTERM);

            // Kill master process in Mac OS
            // @codeCoverageIgnoreStart
            if (PHP_OS == 'Darwin') {
                sleep(1);
                posix_kill($pid, SIGKILL);
            }
            // @codeCoverageIgnoreEnd
        }
        $this->cliOutput('info', 'Service stopped.');
    }
972763
protected function stopped()
    {
        $this->redis->zrem(Queue::redisKey($this->queue, 'running'), $this->payload);

        Stats::decr('running', 1);
        Stats::decr('running', 1, Queue::redisKey($this->queue, 'stats'));
    }
18655
public void stop() {
    try {
      if (server != null) {
        server.stop();
        server.join();
      }
    } catch (Exception e) {
      LOG.warn("Got exception shutting down proxy", e);
    }
  }
1035407
def stop_server(self):
        
        self.stop = True
        while self.task_count:
            time.sleep(END_RESP)
        self.terminate = True
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()
368809
function shutdown()
    {
        if ($this->exception_handler_called) {
            return;
        }

        if (ob_get_level() > 0)
            ob_get_flush();

        if ($this->level) {
            echo ($this->terminal ? PHP_EOL : '<br>');
            $t  = microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];
            $te = sprintf(' %.2f mili sec.', $t * 1000);
            self::dump('Elapsed time: ' . $te, 0);
        }

        if ($this->level > 1) {
            $files = get_included_files();
            self::dump($files, 0);
        }
    }
421617
private function shutdown(): void
    {
        $this->connectionPool->shutdown();

        foreach ($this->connectionHandlers as $connectionHandler) {
            $connectionHandler->shutdown();
        }

        while ($this->connectionPool->count() > 0) {
            $this->processConnectionPool();
        }

        $this->connectionPool->close();
    }
1252855
def stop(self):
        '''
        
        '''
        self._server.shutdown()
        self._server.server_close()
        self._thread.join()
        self.running = False