Move the connection check interval of the ManagedClient to the options.

This commit is contained in:
Christian Kratky
2018-07-04 22:20:24 +02:00
parent 2b420b8e66
commit ce534baa75
3 changed files with 5 additions and 1 deletions
@@ -9,6 +9,8 @@ namespace MQTTnet.Extensions.ManagedClient
TimeSpan AutoReconnectDelay { get; }
TimeSpan ConnectionCheckInterval { get; }
IManagedMqttClientStorage Storage { get; }
}
}
@@ -206,7 +206,7 @@ namespace MQTTnet.Extensions.ManagedClient
if (connectionState == ReconnectionResult.StillConnected)
{
await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken).ConfigureAwait(false);
await Task.Delay(_options.ConnectionCheckInterval, cancellationToken).ConfigureAwait(false);
}
}
catch (OperationCanceledException)
@@ -9,6 +9,8 @@ namespace MQTTnet.Extensions.ManagedClient
public TimeSpan AutoReconnectDelay { get; set; } = TimeSpan.FromSeconds(5);
public TimeSpan ConnectionCheckInterval { get; set; } = TimeSpan.FromSeconds(1);
public IManagedMqttClientStorage Storage { get; set; }
}
}