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

Server: MqttServer.StopAsync() doesn't indicate correct reason #1846

Closed
patrickpracht opened this issue Sep 19, 2023 · 1 comment · Fixed by #1872
Closed

Server: MqttServer.StopAsync() doesn't indicate correct reason #1846

patrickpracht opened this issue Sep 19, 2023 · 1 comment · Fixed by #1872
Labels
bug Something isn't working

Comments

@patrickpracht
Copy link

patrickpracht commented Sep 19, 2023

Describe the bug

When a asp.net core app shuts down gracefully, the client connections are closed with reason MqttClientDisconnectOptionsReason.NormalDisconnection.

Which component is your bug related to?

  • Server

Expected behavior

When a graceful shutdown happens, the client connections should be closed with MqttClientDisconnectOptionsReason.ServerShuttingDown instead.

Sending this reason would make distinction between conditions more easy, f.e. ServerShuttingDown could be used by the client to try reconnecting at a later time (or never).

Additional context / logging

Hosted service is added here: ServiceCollectionExtensions.cs#L75

Shutdown is observed here: MqttHostedServer.cs#L28

Connections are closed here: MqttServer.cs#L295

@patrickpracht patrickpracht added the bug Something isn't working label Sep 19, 2023
@chkr1011
Copy link
Collaborator

chkr1011 commented Nov 4, 2023

Please try exactly build https://www.myget.org/feed/mqttnet/package/nuget/MQTTnet/4.3.1.909 from the myget feed and let me know if the issue is solved.

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

Successfully merging a pull request may close this issue.

2 participants