Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed IDisposable from MqttClientConnection class. #1288

Merged
merged 1 commit into from Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 1 addition & 20 deletions Build/MQTTnet.nuspec
Expand Up @@ -12,26 +12,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker) and supports v3.1.0, v3.1.1 and v5.0.0 of the MQTT protocol.</description>
<releaseNotes>
* [Core] Added all builders to the MQTT factory.
* [Core] Removed global logger and refactored logging (BREAKING CHANGE!).
* [Client] Renamed _MqttClientConnectResult_ to _MqttClientConnectResult_ (BREAKING CHANGE!).
* [ManagedClient] Extended ReconnectAsync (thanks to @nvsnkv, #1202).
* [ManagedClient] Improved Amazon AWS support (thanks to @scottbrogden-iheartmedia, #1209).
* [ManagedClient] Fixed bug that allowed invalid subscriptions (Thanks to @marcelwinh).
* [Server] Added support for _RetainHandling_ (MQTTv5, BREAKING CHANGE!).
* [Server] Added support for _NoLocal_ (MQTTv5, BREAKING CHANGE!).
* [Server] Added support for _SubscriptionIdentifier_ (MQTTv5, BREAKING CHANGE!).
* [Server] Server now reports supported features properly after successful connection (MQTTv5, BREAKING CHANGE!).
* [Server] Fixed a memory/performance leak when using QoS Level 1.
* [Server] Exposed connection timestamp in client status.
* [Server] Refactored connection management code.
* [Server] Exposed more details in _MqttServerClientConnectedEventArgs_.
* [Server] Processing all pending messages before stopping (thanks to @AblEdge, #1234).
* [Server] Added support for a custom exception handler in _MqttServerMultiThreadedApplicationMessageInterceptorDelegate_.
* [Server] Removed logger from _MqttServerMultiThreadedApplicationMessageInterceptorDelegate_ (BREAKING CHANGE!).
* [Server] Fixed a memory leak when deleting sessions.
* [Server] Fixed timestamp check in server keep-alive monitor (thanks to @logicaloud, #1277).
* [MQTTnet.Server] Moved server project to a dedicated GitHub repository.
* [Core] Removed IDisposable from MqttClientConnection.cs (Fixes #1284).
Git commit: $gitCommit
</releaseNotes>
<copyright>Copyright Christian Kratky 2016-2021</copyright>
Expand Down
10 changes: 2 additions & 8 deletions Source/MQTTnet/Server/Internal/MqttClientConnection.cs
@@ -1,11 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using MQTTnet.Adapter;
using MQTTnet.Client;
using MQTTnet.Client.Disconnecting;
using MQTTnet.Diagnostics;
using MQTTnet.Diagnostics.Logger;
using MQTTnet.Exceptions;
using MQTTnet.Formatter;
Expand All @@ -18,7 +17,7 @@

namespace MQTTnet.Server.Internal
{
public sealed class MqttClientConnection : IDisposable
public sealed class MqttClientConnection
{
readonly Dictionary<ushort, string> _topicAlias = new Dictionary<ushort, string>();
readonly MqttPacketIdentifierProvider _packetIdentifierProvider = new MqttPacketIdentifierProvider();
Expand Down Expand Up @@ -107,11 +106,6 @@ public void FillClientStatus(MqttClientStatus clientStatus)
Statistics.FillClientStatus(clientStatus);
}

public void Dispose()
{
_cancellationToken.Dispose();
}

public async Task RunAsync()
{
_logger.Info("Client '{0}': Session started.", ClientId);
Expand Down
2 changes: 0 additions & 2 deletions Source/MQTTnet/Server/Internal/MqttClientSessionsManager.cs
Expand Up @@ -177,8 +177,6 @@ await _eventDispatcher.SafeNotifyClientConnectedAsync(connectPacket, channelAdap
}
}

clientConnection?.Dispose();

await channelAdapter.DisconnectAsync(_options.DefaultCommunicationTimeout, CancellationToken.None)
.ConfigureAwait(false);
}
Expand Down