浏览代码

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 年前
committed by GitHub
父节点
当前提交
bea6d75251
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 3 个文件被更改,包括 16 次插入0 次删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

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


正在加载...
取消
保存