Ejemplo n.º 1
0
        /// <summary>
        /// Handles client side background activities.
        /// </summary>
        private void OnClientBkTimer()
        {
            DateTime now = SysTime.Now;
            Msg      clone;

            using (TimedLock.Lock(base.Router.SyncRoot))
            {
                if (arQuery == null)
                {
                    return;
                }

                // See if it's time to send a retry message

                if (now >= retryTime)
                {
                    retry++;
                    if (retry >= base.Router.SessionRetries)
                    {
                        ClientCancel();
                        return;
                    }

                    Router.Metrics.SessionRetries.Increment();
                    query._Trace(base.Router, 2, "Q/R Retry", null);

                    retryTime        = now + base.Router.SessionTimeout;
                    clone            = query.Clone();
                    clone._SessionID = query._SessionID;

                    base.Router.Send(clone);
                }
            }
        }