Cannot distinguish whether the session expiry interval of a DISCONNECT packet is zero or absent
- Dominant language
- C#
- Stars
- 5.1k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug
The field type of `MqttDisconnectPacket.SessionExpiryInterval` is `uint` instead of `Nullable`, which means we cannot tell whether the session expiry interval is set or zero. According to the [MQTT protocol 5.0 spec](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901211), 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
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.