public function stop() : bool
    {
        $serverPid = $this->getServerPid();
        if ($serverPid === 0) {
            return true;
        }
        $response = $this->sendCommand('stop');
        if ($response !== 'ok') {
            throw new ControlException('Shutdown failed.');
        }
        return true;
    }