ping method
Measures round-trip latency to the Hub.
Implementation
Future<Duration> ping() {
_ensureConnected();
final id = newId();
final completer = Completer<Duration>();
_pendingPings[id] = completer;
_connection!.send(ControlFrame(Ping(id: id, ts: config.clock.now())));
return _rpcTimeout(completer.future, () => _pendingPings.remove(id));
}