Opc.Ua.Com.Server.ComDaGroup.OnDataChange C# (CSharp) Method

OnDataChange() public method

Called when a data change arrives.
public OnDataChange ( Subscription subscription, DataChangeNotification notification, IList stringTable ) : void
subscription Subscription The subscription.
notification DataChangeNotification The notification.
stringTable IList The string table.
return void
        void OnDataChange(Subscription subscription, DataChangeNotification notification, IList<string> stringTable)
        {
            try
            {
                lock (m_lock)
                {
                    for (int jj = 0; jj < notification.MonitoredItems.Count; jj++)
                    {
                        uint clientHandle = notification.MonitoredItems[jj].ClientHandle;

                        // find item.
                        ComDaGroupItem item = null;

                        if (!m_itemsByMonitoredItem.TryGetValue(clientHandle, out item))
                        {
                            continue;
                        }

                        // convert data change.
                        DaValue result = m_manager.Mapper.GetLocalDataValue(notification.MonitoredItems[jj].Value);

                        // update cache.
                        UpdateCache(item, result, false);
                    }
                }
            }
            catch (Exception exception)
            {
                Utils.Trace("Unexpected error during CacheUpdate. {0}", exception.Message);
            }
        }