stop method
Stops the loop and closes the socket cleanly (the iOS background path: suspend → stop, foreground → start — reconnect + flush).
Implementation
Future<void> stop() async {
_started = false;
_reconnectTimer?.cancel();
_reconnectTimer = null;
await _dropSocket();
_setState(HubLinkState.disconnected);
}