Opc.Ua.ServerTest.MonitoredItemTest.DoWrite C# (CSharp) Метод

DoWrite() приватный Метод

Periodically writes to the server.
private DoWrite ( object state ) : void
state object
Результат void
        private void DoWrite(object state)
        {
            try
            {
                int? counter = state as int?;

                lock (m_variables)
                {
                    if (counter == null || counter != m_writeTimerCounter)
                    {
                        return;
                    }

                    if (m_stopped != 0)
                    {
                        return;
                    }
                }

                bool success = Write(counter.Value);
                                
                if (!success)
                {
                    HaltTestOnError(null, "Error occurred while writing values.", null);
                    return;
                }
            }
            catch (Exception e)
            {
                HaltTestOnError(e, "Fatal error while writing values.", null);
            }
        }