Improve connection handling.

This commit is contained in:
Christian Kratky
2019-04-20 21:12:30 +02:00
parent f60bbf7dd7
commit 5c903e6fbf
2 changed files with 12 additions and 18 deletions
@@ -274,17 +274,9 @@ namespace MQTTnet.Server
{
_connections.TryRemove(clientId, out _);
////connection?.ReferenceCounter.Decrement();
////if (connection?.ReferenceCounter.HasReferences == true)
////{
//// disconnectType = MqttClientDisconnectType.Takeover;
////}
////else
if (!_options.EnablePersistentSessions)
{
if (!_options.EnablePersistentSessions)
{
await DeleteSessionAsync(clientId).ConfigureAwait(false);
}
await DeleteSessionAsync(clientId).ConfigureAwait(false);
}
await TryCleanupChannelAsync(channelAdapter).ConfigureAwait(false);