Skip to content

Commit

Permalink
Include channel in callback
Browse files Browse the repository at this point in the history
  • Loading branch information
marcschier committed Dec 2, 2024
1 parent 68dc887 commit 2b376ce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Stack/Opc.Ua.Core/Stack/Tcp/UaSCBinaryChannel.Symmetric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public partial class UaSCUaBinaryChannel
/// <summary>
/// Called when the token changes
/// </summary>
protected internal ChannelTokenActivatedEventHandler OnTokenActivated { get; set; }
protected internal Action<ChannelToken, ChannelToken> OnTokenActivated { get; set; }

/// <summary>
/// Creates a new token.
Expand Down
3 changes: 2 additions & 1 deletion Stack/Opc.Ua.Core/Stack/Tcp/UaSCBinaryTransportChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,8 @@ private UaSCUaBinaryClientChannel CreateChannel(ITransportWaitingConnection conn
}

// Register the token changed event handler with the internal channel
channel.OnTokenActivated = m_OnTokenActivated;
channel.OnTokenActivated =
(current, previous) => m_OnTokenActivated?.Invoke(this, current, previous);
return channel;
}
#endregion
Expand Down
6 changes: 5 additions & 1 deletion Stack/Opc.Ua.Core/Stack/Transport/ITransportChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ namespace Opc.Ua
/// <summary>
/// Callback when the token is activated
/// </summary>
/// <param name="source"></param>
/// <param name="currentToken"></param>
/// <param name="previousToken"></param>
public delegate void ChannelTokenActivatedEventHandler(ChannelToken currentToken, ChannelToken previousToken);
public delegate void ChannelTokenActivatedEventHandler(
ITransportChannel source,
ChannelToken currentToken,
ChannelToken previousToken);

/// <summary>
/// This is an interface to a channel which supports
Expand Down

0 comments on commit 2b376ce

Please sign in to comment.