mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
A subscribe is a short request: the server answers immediately and the device then relies on push notifications. Unlike a listen, nothing keeps it under observation. The keepalive is only armed once the server has answered, and no request in this client ever sets a timeout, so a subscribe stalled in name resolution, connection or TLS handshake never completes and never fails either. The listener then stays registered locally while the server never learns about it: the device stops being notified, without anything reporting an error. This is most likely right after a wake-up, when the network stack is still settling. Arm a deadline on subscribe requests and fail the operation when it expires, so restartListeners() sends the subscription again. Streaming listens are left untouched: they are long lived by design. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>