mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-20 03:24:33 +08:00
Move events to server level instead of options.
This commit is contained in:
@@ -19,14 +19,15 @@ namespace MQTTnet.Tests.Server
|
||||
{
|
||||
testEnvironment.IgnoreClientLogErrors = true;
|
||||
|
||||
await testEnvironment.StartServer(o =>
|
||||
var server = await testEnvironment.StartServer();
|
||||
|
||||
server.ValidatingClientConnectionAsync += e =>
|
||||
{
|
||||
o.WithConnectionValidator(v =>
|
||||
{
|
||||
v.ReasonCode = MqttConnectReasonCode.ServerMoved;
|
||||
v.ServerReference = "new_server";
|
||||
});
|
||||
});
|
||||
e.ReasonCode = MqttConnectReasonCode.ServerMoved;
|
||||
e.ServerReference = "new_server";
|
||||
|
||||
return Task.CompletedTask;
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user