Skip to content

Commit

Permalink
#2656 Fix for - Session is not provided by ClearChangeMasks when a ch…
Browse files Browse the repository at this point in the history
…ange is notified (#2772)

It fixes #2656 by including in the SystemContext (taken as an argument to the OnMonitoredNodeChanged method) the Server session related to the current MonitoredItem that is going to be passed to the QueueValue.
  • Loading branch information
Filippo-Oliva-ABB authored Oct 10, 2024
1 parent 44dc734 commit 9c7b321
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions Libraries/Opc.Ua.Server/Diagnostics/MonitoredNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,31 @@ public void OnMonitoredNodeChanged(ISystemContext context, NodeState node, NodeS

if (monitoredItem.AttributeId == Attributes.Value && (changes & NodeStateChangeMasks.Value) != 0)
{
QueueValue(context, node, monitoredItem);
ServerSystemContext serverSystemContext;
if ((serverSystemContext = (context as ServerSystemContext)) != null)
{
ServerSystemContext context2 = serverSystemContext.Copy(new OperationContext(monitoredItem.Session, monitoredItem.DiagnosticsMasks));
QueueValue(context2, node, monitoredItem);
}
else
{
QueueValue(context, node, monitoredItem);
}
continue;
}

if (monitoredItem.AttributeId != Attributes.Value && (changes & NodeStateChangeMasks.NonValue) != 0)
{
QueueValue(context, node, monitoredItem);
ServerSystemContext serverSystemContext2;
if ((serverSystemContext2 = (context as ServerSystemContext)) != null)
{
ServerSystemContext context3 = serverSystemContext2.Copy(new OperationContext(monitoredItem.Session, monitoredItem.DiagnosticsMasks));
QueueValue(context3, node, monitoredItem);
}
else
{
QueueValue(context, node, monitoredItem);
}
continue;
}
}
Expand Down

0 comments on commit 9c7b321

Please sign in to comment.