From 117f2212d74decba5f0326560aaa2bdb128a4805 Mon Sep 17 00:00:00 2001 From: Marc Schier Date: Mon, 8 Jun 2026 09:46:36 +0200 Subject: [PATCH] Simplify token-activated subscription (channel is always ISecureChannel) (CA1508) --- .../Bindings/PcapTransportChannelBinding.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Stack/Opc.Ua.Bindings.Pcap/Bindings/PcapTransportChannelBinding.cs b/Stack/Opc.Ua.Bindings.Pcap/Bindings/PcapTransportChannelBinding.cs index a29e4e41e2..f62499cdd5 100644 --- a/Stack/Opc.Ua.Bindings.Pcap/Bindings/PcapTransportChannelBinding.cs +++ b/Stack/Opc.Ua.Bindings.Pcap/Bindings/PcapTransportChannelBinding.cs @@ -87,10 +87,7 @@ namespace Opc.Ua.Bindings.Pcap.Bindings // offline decoder receives the derived key material alongside // the wire bytes. Subscribing here once per channel is // cheaper than subscribing at every send/receive site. - if (channel is ISecureChannel secureChannel) - { - secureChannel.OnTokenActivated += OnChannelTokenActivated; - } + ((ISecureChannel)channel).OnTokenActivated += OnChannelTokenActivated; return channel; }