Procházet zdrojové kódy

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 před 4 roky
committed by GitHub
rodič
revize
bea6d75251
V databázi nebyl nalezen žádný známý klíč pro tento podpis ID GPG klíče: 4AEE18F83AFDEB23
3 změnil soubory, kde provedl 16 přidání a 0 odebrání
  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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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;


Načítá se…
Zrušit
Uložit