Explorar el Código

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 hace 4 años
committed by GitHub
padre
commit
bea6d75251
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: 4AEE18F83AFDEB23
Se han modificado 3 ficheros con 16 adiciones y 0 borrados
  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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

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


Cargando…
Cancelar
Guardar