close method
Closes every connection and drops all state.
Implementation
Future<void> close() async {
_ttlTimer?.cancel();
_ttlTimer = null;
for (final pending in _pending.values.toList(growable: false)) {
pending.deadline.cancel();
await pending.socket.close();
}
_pending.clear();
for (final connection in _connections.values.toList(growable: false)) {
await connection.socket.close();
}
_connections.clear();
_routing.clear();
_registry.dispose();
}