Skip to content

Commit

Permalink
Remove client disconnected handler from wrong implementation location.
Browse files Browse the repository at this point in the history
  • Loading branch information
chkr1011 committed Apr 11, 2021
1 parent 7733852 commit 8f1d4e3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 24 deletions.
9 changes: 3 additions & 6 deletions Source/MQTTnet/Server/IMqttServerOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public interface IMqttServerOptions
/// Gets the client identifier.
/// Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues.
/// </summary>
string ClientId { get; set; }
string ClientId { get; }

bool EnablePersistentSessions { get; }

Expand All @@ -23,16 +23,13 @@ public interface IMqttServerOptions
IMqttServerUnsubscriptionInterceptor UnsubscriptionInterceptor { get; }
IMqttServerApplicationMessageInterceptor ApplicationMessageInterceptor { get; }
IMqttServerClientMessageQueueInterceptor ClientMessageQueueInterceptor { get; }

IMqttServerApplicationMessageInterceptor UndeliveredMessageInterceptor { get; }

MqttServerTcpEndpointOptions DefaultEndpointOptions { get; }
MqttServerTlsTcpEndpointOptions TlsEndpointOptions { get; }

IMqttServerStorage Storage { get; }

IMqttRetainedMessagesManager RetainedMessagesManager { get; }

IMqttServerApplicationMessageInterceptor UndeliveredMessageInterceptor { get; set; }

IMqttServerClientDisconnectedHandler ClientDisconnectedInterceptor { get; set; }
}
}
1 change: 0 additions & 1 deletion Source/MQTTnet/Server/MqttClientSessionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using System.Threading;
using System.Threading.Tasks;
using MQTTnet.Client.Disconnecting;
using OperationCanceledException = System.OperationCanceledException;

namespace MQTTnet.Server
{
Expand Down
6 changes: 2 additions & 4 deletions Source/MQTTnet/Server/MqttServerOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ public class MqttServerOptions : IMqttServerOptions

public IMqttServerUnsubscriptionInterceptor UnsubscriptionInterceptor { get; set; }

public IMqttServerApplicationMessageInterceptor UndeliveredMessageInterceptor { get; set; }

public IMqttServerStorage Storage { get; set; }

public IMqttRetainedMessagesManager RetainedMessagesManager { get; set; } = new MqttRetainedMessagesManager();

public IMqttServerApplicationMessageInterceptor UndeliveredMessageInterceptor { get; set; }

public IMqttServerClientDisconnectedHandler ClientDisconnectedInterceptor { get; set; }
}
}
14 changes: 1 addition & 13 deletions Source/MQTTnet/Server/MqttServerOptionsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,7 @@ public MqttServerOptionsBuilder WithConnectionValidator(Func<MqttConnectionValid
_options.ConnectionValidator = new MqttServerConnectionValidatorDelegate(value);
return this;
}

public MqttServerOptionsBuilder WithDisconnectedInterceptor(IMqttServerClientDisconnectedHandler value)
{
_options.ClientDisconnectedInterceptor = value;
return this;
}

public MqttServerOptionsBuilder WithDisconnectedInterceptor(Action<MqttServerClientDisconnectedEventArgs> value)
{
_options.ClientDisconnectedInterceptor = new MqttServerClientDisconnectedHandlerDelegate(value);
return this;
}


public MqttServerOptionsBuilder WithApplicationMessageInterceptor(IMqttServerApplicationMessageInterceptor value)
{
_options.ApplicationMessageInterceptor = value;
Expand Down

0 comments on commit 8f1d4e3

Please sign in to comment.