fixed invalid operation exception

This commit is contained in:
JanEggers
2017-09-16 08:13:46 +02:00
parent d7e2b18247
commit f8c01b2168
+2 -1
View File
@@ -340,8 +340,9 @@ namespace MQTTnet.Core.Client
private async Task<TResponsePacket> SendAndReceiveAsync<TResponsePacket>(MqttBasePacket requestPacket) where TResponsePacket : MqttBasePacket
{
var wait = _packetDispatcher.WaitForPacketAsync(requestPacket, typeof(TResponsePacket), _options.DefaultCommunicationTimeout);
await _adapter.SendPacketsAsync(_options.DefaultCommunicationTimeout, requestPacket).ConfigureAwait(false);
return (TResponsePacket)await _packetDispatcher.WaitForPacketAsync(requestPacket, typeof(TResponsePacket), _options.DefaultCommunicationTimeout).ConfigureAwait(false);
return (TResponsePacket)await wait.ConfigureAwait(false);
}
private ushort GetNewPacketIdentifier()