Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeepAlive not triggering DisconnectEvent in due time #2108

Open
Erw1nT opened this issue Nov 18, 2024 · 0 comments
Open

KeepAlive not triggering DisconnectEvent in due time #2108

Erw1nT opened this issue Nov 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Erw1nT
Copy link

Erw1nT commented Nov 18, 2024

Setup:

  1. Setup a hotspot with your smartphone
  2. Connect to the hotspot network with your MQTTNet client (ManagedClient, Websocket, TLS)
  3. Start the MQTTNet client and connect to a broker
  4. Disable the mobile data of the smartphone so that the hotspot is available but is not connected to the internet

KeepAlive is set to 5s.

Expected Behaviour:
After KeepAlive * 1.5 (= around 7-8s), the Disconnect-Event should be fired so that it can be handled.
(i.e. show a Connection-Lost screen)

Actual Behaviour:
After a random time (sometimes between 20-30s, sometimes never) the Disconnect-Event is fired and can be handled.

MQTTnet Version:

  • 4.3.7.1207

Component:

  • ManagedClient

We are running the MQTTnet client in the browser as a blazor wasm application.

Logs:
2024-11-18 11:33:24.293 +01:00 [WRN] MqttClient / Communication error while sending/receiving keep alive packets
2024-11-18 11:33:24.295 +01:00 [VRB] MqttClient / Stopped sending keep alive packets
2024-11-18 11:33:24.296 +01:00 [INF] MqttClient / Disconnected.
2024-11-18 11:33:24.299 +01:00 [VRB] MqttClient / Stopped receiving packets
2024-11-18 11:33:24.299 +01:00 [ERR] Disconnected with reason: NormalDisconnection

Note to Logs:
The entries appear in correct order but start later than the expected 7-8s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant