mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-18 02:13:00 +08:00
Add session to subscribe interceptor.
This commit is contained in:
@@ -73,12 +73,12 @@ namespace MQTTnet.TestApp.NetCore
|
||||
{
|
||||
if (context.TopicFilter.Topic.StartsWith("admin/foo/bar") && context.ClientId != "theAdmin")
|
||||
{
|
||||
context.AcceptSubscription = false;
|
||||
context.ReasonCode = MqttSubscribeReasonCode.ImplementationSpecificError;
|
||||
}
|
||||
|
||||
if (context.TopicFilter.Topic.StartsWith("the/secret/stuff") && context.ClientId != "Imperator")
|
||||
{
|
||||
context.AcceptSubscription = false;
|
||||
context.ReasonCode = MqttSubscribeReasonCode.ImplementationSpecificError;
|
||||
context.CloseConnection = true;
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user