Improve session handling.

This commit is contained in:
Christian Kratky
2019-01-01 19:18:54 +01:00
parent 4cba814716
commit 96a67579e2
13 changed files with 478 additions and 219 deletions
+3 -3
View File
@@ -56,7 +56,7 @@ namespace MQTTnet.Server
return _retainedMessagesManager.GetMessagesAsync().GetAwaiter().GetResult();
}
public Task SubscribeAsync(string clientId, IList<TopicFilter> topicFilters)
public Task SubscribeAsync(string clientId, IEnumerable<TopicFilter> topicFilters)
{
if (clientId == null) throw new ArgumentNullException(nameof(clientId));
if (topicFilters == null) throw new ArgumentNullException(nameof(topicFilters));
@@ -64,7 +64,7 @@ namespace MQTTnet.Server
return _clientSessionsManager.SubscribeAsync(clientId, topicFilters);
}
public Task UnsubscribeAsync(string clientId, IList<string> topicFilters)
public Task UnsubscribeAsync(string clientId, IEnumerable<string> topicFilters)
{
if (clientId == null) throw new ArgumentNullException(nameof(clientId));
if (topicFilters == null) throw new ArgumentNullException(nameof(topicFilters));
@@ -118,7 +118,7 @@ namespace MQTTnet.Server
_cancellationTokenSource.Cancel(false);
_clientSessionsManager.StopAsync().ConfigureAwait(false);
await _clientSessionsManager.StopAsync().ConfigureAwait(false);
foreach (var adapter in _adapters)
{