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,5 +1,6 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading.Tasks;
using MQTTnet.Core.Adapter;
using MQTTnet.Core.Client;
@@ -26,11 +27,15 @@ namespace MQTTnet.Core.Tests
return Task.FromResult(0);
}
public Task SendPacketAsync(MqttBasePacket packet, TimeSpan timeout)
public Task SendPacketsAsync(TimeSpan timeout, IEnumerable<MqttBasePacket> packets)
{
ThrowIfPartnerIsNull();
Partner.SendPacketInternal(packet);
foreach (var packet in packets)
{
Partner.SendPacketInternal(packet);
}
return Task.FromResult(0);
}