mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-20 03:24:33 +08:00
send multiple packages at once msg/sec from 9000 to 32000
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user