mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-25 15:42:57 +08:00
Fix issues in MQTTv5 packet encoding and decoding.
This commit is contained in:
@@ -23,6 +23,16 @@ namespace MQTTnet.PacketDispatcher
|
||||
{
|
||||
if (packet == null) throw new ArgumentNullException(nameof(packet));
|
||||
|
||||
if (packet is MqttDisconnectPacket disconnectPacket)
|
||||
{
|
||||
foreach (var packetAwaiter in _packetAwaiters)
|
||||
{
|
||||
packetAwaiter.Value.Fail(new MqttUnexpectedDisconnectReceivedException(disconnectPacket));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ushort identifier = 0;
|
||||
if (packet is IMqttPacketWithIdentifier packetWithIdentifier && packetWithIdentifier.PacketIdentifier.HasValue)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user