Преглед на файлове

Even more performance optimizations

release/3.x.x
Christian Kratky преди 7 години
родител
ревизия
6b1a6c054e
променени са 6 файла, в които са добавени 14 реда и са изтрити 11 реда
  1. +1
    -1
      MQTTnet.Core/Packets/MqttConnAckPacket.cs
  2. +2
    -2
      MQTTnet.Core/Packets/MqttConnectPacket.cs
  3. +8
    -3
      MQTTnet.Core/Packets/MqttPublishPacket.cs
  4. +1
    -2
      MQTTnet.Core/Packets/MqttSubAckPacket.cs
  5. +1
    -2
      MQTTnet.Core/Packets/MqttSubscribePacket.cs
  6. +1
    -1
      MQTTnet.Core/Server/MqttClientSession.cs

+ 1
- 1
MQTTnet.Core/Packets/MqttConnAckPacket.cs Целия файл

@@ -10,7 +10,7 @@ namespace MQTTnet.Core.Packets

public override string ToString()
{
return $"{nameof(MqttConnAckPacket)}: [ConnectReturnCode={ConnectReturnCode}] [IsSessionPresent={IsSessionPresent}]";
return nameof(MqttConnAckPacket) + ": [ConnectReturnCode=" + ConnectReturnCode + "] [IsSessionPresent=" + IsSessionPresent + "]";
}
}
}

+ 2
- 2
MQTTnet.Core/Packets/MqttConnectPacket.cs Целия файл

@@ -2,7 +2,7 @@

namespace MQTTnet.Core.Packets
{
public sealed class MqttConnectPacket: MqttBasePacket
public sealed class MqttConnectPacket : MqttBasePacket
{
public MqttProtocolVersion ProtocolVersion { get; set; }

@@ -20,7 +20,7 @@ namespace MQTTnet.Core.Packets

public override string ToString()
{
return $"{nameof(MqttConnectPacket)} [ClientId={ClientId}] [Username={Username}] [Password={Password}] [KeepAlivePeriod={KeepAlivePeriod}] [CleanSession={CleanSession}]";
return nameof(MqttConnectPacket) + ": [ClientId=" + ClientId + "] [Username=" + Username + "] [Password=" + Password + "] [KeepAlivePeriod=" + KeepAlivePeriod + "] [CleanSession=" + CleanSession + "]";
}
}
}

+ 8
- 3
MQTTnet.Core/Packets/MqttPublishPacket.cs Целия файл

@@ -1,4 +1,4 @@
using System.Text;
using System;
using MQTTnet.Core.Protocol;

namespace MQTTnet.Core.Packets
@@ -17,8 +17,13 @@ namespace MQTTnet.Core.Packets

public override string ToString()
{
return
$"{nameof(MqttPublishPacket)} [Topic={Topic}] [Payload={Encoding.UTF8.GetString(Payload, 0, Payload.Length)}] [QoSLevel={QualityOfServiceLevel}] [Dup={Dup}] [Retain={Retain}] [PacketIdentifier={PacketIdentifier}]";
return nameof(MqttPublishPacket) +
": [Topic=" + Topic + "]" +
" [Payload=" + Convert.ToBase64String(Payload) + "]" +
" [QoSLevel=" + QualityOfServiceLevel + "]" +
" [Dup=" + Dup + "]" +
" [Retain=" + Retain + "]" +
" [PacketIdentifier=" + PacketIdentifier + "]";
}
}
}

+ 1
- 2
MQTTnet.Core/Packets/MqttSubAckPacket.cs Целия файл

@@ -13,8 +13,7 @@ namespace MQTTnet.Core.Packets
public override string ToString()
{
var subscribeReturnCodesText = string.Join(",", SubscribeReturnCodes.Select(f => f.ToString()));
return
$"{nameof(MqttSubAckPacket)} [PacketIdentifier={PacketIdentifier}] [SubscribeReturnCodes={subscribeReturnCodesText}]";
return nameof(MqttSubAckPacket) + ": [PacketIdentifier=" + PacketIdentifier + "] [SubscribeReturnCodes=" + subscribeReturnCodesText + "]";
}
}
}

+ 1
- 2
MQTTnet.Core/Packets/MqttSubscribePacket.cs Целия файл

@@ -12,8 +12,7 @@ namespace MQTTnet.Core.Packets
public override string ToString()
{
var topicFiltersText = string.Join(",", TopicFilters.Select(f => $"{f.Topic}@{f.QualityOfServiceLevel}"));
return
$"{nameof(MqttSubscribePacket)} [PacketIdentifier={PacketIdentifier}] [TopicFilters={topicFiltersText}]";
return nameof(MqttSubscribePacket) + ": [PacketIdentifier=" + PacketIdentifier + "] [TopicFilters=" + topicFiltersText + "]";
}
}
}

+ 1
- 1
MQTTnet.Core/Server/MqttClientSession.cs Целия файл

@@ -76,7 +76,7 @@ namespace MQTTnet.Core.Server
_cancellationTokenSource.Cancel();
Adapter = null;

MqttTrace.Information(nameof(MqttClientSession), $"Client '{_identifier}': Disconnected.");
MqttTrace.Information(nameof(MqttClientSession), "Client '{0}': Disconnected.", _identifier);
}
}



Зареждане…
Отказ
Запис