From 9b29f8c23a5417650c7f5e03ee4fa22e97947e30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Warin?= Date: Fri, 18 May 2018 17:10:28 +0200 Subject: [PATCH] Fix MqttProtocolVersion 3.1 connection --- .../MQTTnet.NetStandard/Serializer/MqttPacketSerializer.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Frameworks/MQTTnet.NetStandard/Serializer/MqttPacketSerializer.cs b/Frameworks/MQTTnet.NetStandard/Serializer/MqttPacketSerializer.cs index 12330b5..943d49e 100644 --- a/Frameworks/MQTTnet.NetStandard/Serializer/MqttPacketSerializer.cs +++ b/Frameworks/MQTTnet.NetStandard/Serializer/MqttPacketSerializer.cs @@ -205,11 +205,7 @@ namespace MQTTnet.Serializer } else { - var buffer = new byte[6]; - Array.Copy(protocolName, buffer, 4); - protocolName = stream.ReadBytes(2); - Array.Copy(protocolName, 0, buffer, 4, 2); - + protocolName = protocolName.Concat(stream.ReadBytes(2)).ToArray(); if (protocolName.SequenceEqual(ProtocolVersionV310Name)) { protocolVersion = MqttProtocolVersion.V310;