Added suport to Persistence and refoactoring

This commit is contained in:
Gerardo
2017-10-18 16:41:54 +02:00
parent ea5616002a
commit bc19f66812
17 changed files with 239 additions and 422 deletions
+3 -3
View File
@@ -21,8 +21,8 @@ namespace MQTTnet.Core.Client
private MqttClientOptions _options;
private bool _isReceivingPackets;
private int _latestPacketIdentifier;
private CancellationTokenSource _cancellationTokenSource;
private IMqttCommunicationAdapter _adapter;
internal CancellationTokenSource _cancellationTokenSource;
internal IMqttCommunicationAdapter _adapter;
public MqttClient(IMqttCommunicationAdapterFactory communicationChannelFactory)
{
@@ -344,7 +344,7 @@ namespace MQTTnet.Core.Client
return _adapter.SendPacketsAsync(_options.DefaultCommunicationTimeout, _cancellationTokenSource.Token, packet);
}
private async Task<TResponsePacket> SendAndReceiveAsync<TResponsePacket>(MqttBasePacket requestPacket) where TResponsePacket : MqttBasePacket
internal async Task<TResponsePacket> SendAndReceiveAsync<TResponsePacket>(MqttBasePacket requestPacket) where TResponsePacket : MqttBasePacket
{
var packetAwaiter = _packetDispatcher.WaitForPacketAsync(requestPacket, typeof(TResponsePacket), _options.DefaultCommunicationTimeout);
await _adapter.SendPacketsAsync(_options.DefaultCommunicationTimeout, _cancellationTokenSource.Token, requestPacket).ConfigureAwait(false);