mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
When a device wakes up from Doze mode or switches networks (e.g. WiFi to 4G), old TCP sockets may become silently dead. When connectivityChanged() is called, the proxy client triggers a new HTTP request (getProxyInfos) which succeeds since it uses a fresh socket, leading the client to believe the connection is still UP. Because the status doesn't change (Connected -> Connected), launchConnectedCbs_ was not set, and restartListeners() was never invoked. Consequently, push subscriptions and permanent puts were not renewed on the proxy, causing the device to appear offline on the DHT. This forces launchConnectedCbs_ to true on connectivityChanged, ensuring that listeners and subscriptions are properly restarted.