Selaa lähdekoodia

Merge pull request #993 from chkr1011/client-disconnected-handler

Tried to add a MqttServerOptions fluent method for the client disconn…
release/3.x.x
Christian 4 vuotta sitten
committed by GitHub
vanhempi
commit
bea6d75251
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 muutettua tiedostoa jossa 16 lisäystä ja 0 poistoa
  1. +2
    -0
      Source/MQTTnet/Server/IMqttServerOptions.cs
  2. +2
    -0
      Source/MQTTnet/Server/MqttServerOptions.cs
  3. +12
    -0
      Source/MQTTnet/Server/MqttServerOptionsBuilder.cs

+ 2
- 0
Source/MQTTnet/Server/IMqttServerOptions.cs Näytä tiedosto

@@ -27,5 +27,7 @@ namespace MQTTnet.Server
IMqttRetainedMessagesManager RetainedMessagesManager { get; }

IMqttServerApplicationMessageInterceptor UndeliveredMessageInterceptor { get; set; }

IMqttServerClientDisconnectedHandler ClientDisconnectedInterceptor { get; set; }
}
}

+ 2
- 0
Source/MQTTnet/Server/MqttServerOptions.cs Näytä tiedosto

@@ -33,5 +33,7 @@ namespace MQTTnet.Server
public IMqttRetainedMessagesManager RetainedMessagesManager { get; set; } = new MqttRetainedMessagesManager();

public IMqttServerApplicationMessageInterceptor UndeliveredMessageInterceptor { get; set; }

public IMqttServerClientDisconnectedHandler ClientDisconnectedInterceptor { get; set; }
}
}

+ 12
- 0
Source/MQTTnet/Server/MqttServerOptionsBuilder.cs Näytä tiedosto

@@ -163,6 +163,18 @@ namespace MQTTnet.Server
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;


Ladataan…
Peruuta
Tallenna