diff --git a/Source/MQTTnet/Server/IMqttServerOptions.cs b/Source/MQTTnet/Server/IMqttServerOptions.cs index cd0cd40b..f5cad0dc 100644 --- a/Source/MQTTnet/Server/IMqttServerOptions.cs +++ b/Source/MQTTnet/Server/IMqttServerOptions.cs @@ -8,7 +8,7 @@ namespace MQTTnet.Server /// 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 @@ namespace MQTTnet.Server 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 3784d429..ebc43985 100644 --- a/Source/MQTTnet/Server/MqttClientSessionsManager.cs +++ b/Source/MQTTnet/Server/MqttClientSessionsManager.cs @@ -13,7 +13,6 @@ using System.Linq; 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 ab52813d..1457d9ef 100644 --- a/Source/MQTTnet/Server/MqttServerOptions.cs +++ b/Source/MQTTnet/Server/MqttServerOptions.cs @@ -34,12 +34,10 @@ namespace MQTTnet.Server 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 fdbf0c1b..386c40ff 100644 --- a/Source/MQTTnet/Server/MqttServerOptionsBuilder.cs +++ b/Source/MQTTnet/Server/MqttServerOptionsBuilder.cs @@ -170,19 +170,7 @@ namespace MQTTnet.Server _options.ConnectionValidator = new MqttServerConnectionValidatorDelegate(value); return this; } - - public MqttServerOptionsBuilder WithDisconnectedInterceptor(IMqttServerClientDisconnectedHandler value) - { - _options.ClientDisconnectedInterceptor = value; - return this; - } - - public MqttServerOptionsBuilder WithDisconnectedInterceptor(Action value) - { - _options.ClientDisconnectedInterceptor = new MqttServerClientDisconnectedHandlerDelegate(value); - return this; - } - + public MqttServerOptionsBuilder WithApplicationMessageInterceptor(IMqttServerApplicationMessageInterceptor value) { _options.ApplicationMessageInterceptor = value;