Remove client disconnected handler from wrong implementation location.

This commit is contained in:
Christian
2021-04-11 20:34:35 +02:00
parent 77338527b4
commit 8f1d4e3c22
4 changed files with 6 additions and 24 deletions
+3 -6
View File
@@ -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.
/// </summary>
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; }
}
}
@@ -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
{
+2 -4
View File
@@ -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; }
}
}
@@ -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<MqttServerClientDisconnectedEventArgs> value)
{
_options.ClientDisconnectedInterceptor = new MqttServerClientDisconnectedHandlerDelegate(value);
return this;
}
public MqttServerOptionsBuilder WithApplicationMessageInterceptor(IMqttServerApplicationMessageInterceptor value)
{
_options.ApplicationMessageInterceptor = value;