src/_legacyCode/Server.php
private function upgradeClient(ClientUpgradeException $upgrade)
    {
        $oldClient = $upgrade->getOldClient();

        if (!isset($oldClient->socket, $this->nodes[(int)$oldClient->socket])) {
            $this->logger->emergency("Client $oldClient not found during upgrade");
            throw new ServerException('Tried to upgrade non existing client!');
        }

        $this->nodes[(int)$oldClient->socket] = $upgrade->getNewClient();
    }
private function upgradeClient(ClientUpgradeException $upgrade)
    {
        $oldClient = $upgrade->getOldClient();

        if (!isset($oldClient->socket, $this->nodes[(int)$oldClient->socket])) {
            $this->logger->emergency("Client $oldClient not found during upgrade");
            throw new ServerException('Tried to upgrade non existing client!');
        }

        $this->nodes[(int)$oldClient->socket] = $upgrade->getNewClient();
    }
private function upgradeClient ( ClientUpgradeException $ upgrade ) { $ oldClient = $ upgrade -> getOldClient ( ) ; if ( ! isset ( $ oldClient -> socket , $ this -> nodes [ ( int ) $ oldClient -> socket ] ) ) { $ this -> logger -> emergency ( "Client $oldClient not found during upgrade" ) ; throw new ServerException ( 'Tried to upgrade non existing client!' ) ; } $ this -> nodes [ ( int ) $ oldClient -> socket ] = $ upgrade -> getNewClient ( ) ; }
Upgrades client protocol.
It's done by replacing whole client class in nodes table.

@param ClientUpgradeException $upgrade

@throws ServerException Old client cannot be found on server (it's serious error)
Upgrades client protocol . It s done by replacing whole client class in nodes table .