Performance improvements in area of logging and async/await

This commit is contained in:
Christian Kratky
2017-09-09 22:40:37 +02:00
parent 04036cf63a
commit 8aec1583df
12 changed files with 153 additions and 132 deletions
@@ -18,12 +18,12 @@ namespace MQTTnet.Core.Tests
public async Task ConnectAsync(MqttClientOptions options, TimeSpan timeout)
{
await Task.FromResult(0).ConfigureAwait(false);
await Task.FromResult(0);
}
public async Task DisconnectAsync()
{
await Task.FromResult(0).ConfigureAwait(false);
await Task.FromResult(0);
}
public async Task SendPacketAsync(MqttBasePacket packet, TimeSpan timeout)
@@ -31,14 +31,14 @@ namespace MQTTnet.Core.Tests
ThrowIfPartnerIsNull();
Partner.SendPacketInternal(packet);
await Task.FromResult(0).ConfigureAwait(false);
await Task.FromResult(0);
}
public async Task<MqttBasePacket> ReceivePacketAsync(TimeSpan timeout)
{
ThrowIfPartnerIsNull();
return await Task.Run(() => _incomingPackets.Take()).ConfigureAwait(false);
return await Task.Run(() => _incomingPackets.Take());
}
private void SendPacketInternal(MqttBasePacket packet)