send($server->getUri()); $socket = yield $server->accept(); if (!$socket instanceof ChannelledSocket) { throw new \RuntimeException('Socket is not instance of ChannelledSocket'); } while (yield $socket->receive()); yield $socket->disconnect(); $server->close(); return $server->accept(); };