send multiple packages at once msg/sec from 9000 to 32000

This commit is contained in:
Eggers Jan
2017-09-13 09:14:08 +02:00
parent 090e59e99a
commit 473c8e0a15
15 changed files with 151 additions and 81 deletions
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using MQTTnet.Core.Client;
using MQTTnet.Core.Packets;
@@ -12,10 +13,18 @@ namespace MQTTnet.Core.Adapter
Task DisconnectAsync();
Task SendPacketAsync(MqttBasePacket packet, TimeSpan timeout);
Task SendPacketsAsync( TimeSpan timeout, IEnumerable<MqttBasePacket> packets );
Task<MqttBasePacket> ReceivePacketAsync(TimeSpan timeout);
IMqttPacketSerializer PacketSerializer { get; }
}
public static class IMqttCommunicationAdapterExtensions
{
public static Task SendPacketsAsync( this IMqttCommunicationAdapter adapter, TimeSpan timeout, params MqttBasePacket[] packets )
{
return adapter.SendPacketsAsync( timeout, packets );
}
}
}