getUri().PHP_EOL; $socket = $server->accept(); if (!$socket instanceof ChannelledSocket) { throw new \RuntimeException('Socket is not instance of ChannelledSocket'); } $ping = $socket->receive(); if ($ping !== 'ping') { throw new \RuntimeException("Received $ping instead of ping!"); } $socket->send('pong'); $socket->disconnect(); $server->close(); $server->accept();