diff --git a/Source/MQTTnet/Server/IMqttServerOptions.cs b/Source/MQTTnet/Server/IMqttServerOptions.cs index cd0cd40b7..f5cad0dc3 100644 --- a/Source/MQTTnet/Server/IMqttServerOptions.cs +++ b/Source/MQTTnet/Server/IMqttServerOptions.cs @@ -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. /// - string ClientId { get; set; } + string ClientId { get; } bool EnablePersistentSessions { get; } @@ -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; } } } \ No newline at end of file diff --git a/Source/MQTTnet/Server/MqttClientSessionsManager.cs b/Source/MQTTnet/Server/MqttClientSessionsManager.cs index 3784d4299..ebc43985b 100644 --- a/Source/MQTTnet/Server/MqttClientSessionsManager.cs +++ b/Source/MQTTnet/Server/MqttClientSessionsManager.cs @@ -13,7 +13,6 @@ using System.Threading; using System.Threading.Tasks; using MQTTnet.Client.Disconnecting; -using OperationCanceledException = System.OperationCanceledException; namespace MQTTnet.Server { diff --git a/Source/MQTTnet/Server/MqttServerOptions.cs b/Source/MQTTnet/Server/MqttServerOptions.cs index ab52813d4..1457d9ef1 100644 --- a/Source/MQTTnet/Server/MqttServerOptions.cs +++ b/Source/MQTTnet/Server/MqttServerOptions.cs @@ -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; } } } diff --git a/Source/MQTTnet/Server/MqttServerOptionsBuilder.cs b/Source/MQTTnet/Server/MqttServerOptionsBuilder.cs index fdbf0c1bf..386c40ffe 100644 --- a/Source/MQTTnet/Server/MqttServerOptionsBuilder.cs +++ b/Source/MQTTnet/Server/MqttServerOptionsBuilder.cs @@ -170,19 +170,7 @@ public MqttServerOptionsBuilder WithConnectionValidator(Func value) - { - _options.ClientDisconnectedInterceptor = new MqttServerClientDisconnectedHandlerDelegate(value); - return this; - } - + public MqttServerOptionsBuilder WithApplicationMessageInterceptor(IMqttServerApplicationMessageInterceptor value) { _options.ApplicationMessageInterceptor = value;