Opc.Ua.Client.SessionReconnectHandler.OnReconnect C# (CSharp) Method

OnReconnect() private method

Called when the reconnect timer expires.
private OnReconnect ( object state ) : void
state object
return void
        private void OnReconnect(object state)
        {
            try
            {
                // check for exit.
                if (m_reconnectTimer == null)
                {
                    return;
                }

                // do the reconnect.
                if (DoReconnect())
                {
                    lock (m_lock)
                    {
                        if (m_reconnectTimer != null)
                        {
                            m_reconnectTimer.Dispose();
                            m_reconnectTimer = null;
                        }
                    }

                    // notify the caller.
                    m_callback(this, null);
                }
            }
            catch (Exception exception)
            {
                Utils.Trace(exception, "Unexpected error during reconnect.");
            }
        }