public function stop($quit = true): int
    {
        if (!$masterPid = $this->getPidFromFile(true)) {
            return Show::error("The swoole server({$this->name}) is not running.");
        }

        // Show::write("The swoole server({$this->name}:{$masterPid}) process stopping ", false);

        ProcessUtil::killAndWait($masterPid, $error = null, $this->name);

        if ($error) {
            return Show::error($error);
        }

        ServerUtil::removePidFile($this->pidFile);

        // stop success
        return Show::write("The swoole server({$this->name}) process stop success", $quit);
    }
public function stop($quit = true): int
    {
        if (!$masterPid = $this->getPidFromFile(true)) {
            return Show::error("The swoole server({$this->name}) is not running.");
        }

        // Show::write("The swoole server({$this->name}:{$masterPid}) process stopping ", false);

        ProcessUtil::killAndWait($masterPid, $error = null, $this->name);

        if ($error) {
            return Show::error($error);
        }

        ServerUtil::removePidFile($this->pidFile);

        // stop success
        return Show::write("The swoole server({$this->name}) process stop success", $quit);
    }
public function stop ( $ quit = true ) : int { if ( ! $ masterPid = $ this -> getPidFromFile ( true ) ) { return Show :: error ( "The swoole server({$this->name}) is not running." ) ; } // Show::write("The swoole server({$this->name}:{$masterPid}) process stopping ", false); ProcessUtil :: killAndWait ( $ masterPid , $ error = null , $ this -> name ) ; if ( $ error ) { return Show :: error ( $ error ) ; } ServerUtil :: removePidFile ( $ this -> pidFile ) ; // stop success return Show :: write ( "The swoole server({$this->name}) process stop success" , $ quit ) ; }
Do stop swoole server
@param  boolean $quit Quit, When stop success?
@return int
Do stop swoole server