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

Cannot distinguish whether the session expiry interval of a DISCONNECT packet is zero or absent #1879

Open
Y-Sindo opened this issue Nov 16, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Y-Sindo
Copy link
Contributor

Y-Sindo commented Nov 16, 2023

Describe the bug

The field type of MqttDisconnectPacket.SessionExpiryInterval is uint instead of Nullable<uint>, which means we cannot tell whether the session expiry interval is set or zero. According to the MQTT protocol 5.0 spec, the absence and zero-value of the session expiry interval have different meaning.

To Reproduce

https://github.com/dotnet/MQTTnet/blob/b9683c29436cace6dfa0b00affbe6b5f03e06b5b/Source/MQTTnet/Packets/MqttDisconnectPacket.cs#L30C1-L30C1

Expected behavior

Use long or uint? instead of uint to represent the field

@Y-Sindo Y-Sindo added the bug Something isn't working label Nov 16, 2023
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