예제 #1
0
 private void CheckT3Timeout()
 {
     try
     {
         List <long> list = new List <long>();
         foreach (long num in this.t3TimerDict.Keys)
         {
             list.Add(num);
         }
         for (int i = 0; i < list.Count; i++)
         {
             HSMSTimer.CheckTimerPara para = this.t3TimerDict[list[i]];
             double num2 = (DateTime.Now - para.StartTime).TotalMilliseconds / 1000.0;
             if (num2 > (double)this.t3Interval)
             {
                 this.logger.Debug(string.Format("HSMSTimer::CheckT3Timeout: {0}, {1}", num2, para.SystemBytes));
                 this.logger.Warn(string.Format("T3 Timeout: System Bytes={0}", para.SystemBytes));
                 this.t3TimerDict.Remove(list[i]);
                 TimerPara para2 = new TimerPara
                 {
                     Type = eTimeout.T3,
                     Msg  = para.msg
                 };
                 this.timeoutQueue.Enqueue(para2);
             }
         }
     }
     catch (Exception exception)
     {
         this.logger.Error("CheckT3Timeout: ", exception);
     }
 }
예제 #2
0
 private void StartTimer(eTimeout e)
 {
     try
     {
         lock (this.syncTimeout)
         {
             HSMSTimer.CheckTimerPara para = new HSMSTimer.CheckTimerPara
             {
                 SystemBytes = (long)e,
                 msg         = null,
                 StartTime   = DateTime.Now
             };
             this.otherTimerDict.Add(e, para);
         }
         this.logger.Debug(string.Format("Timer::StartTimer {0}", e));
     }
     catch (Exception exception)
     {
         this.logger.Error("Timer::StartTimer ", exception);
     }
 }
예제 #3
0
 private void CheckOtherTimeout()
 {
     try
     {
         List <eTimeout> list = new List <eTimeout>();
         foreach (eTimeout timeout in this.otherTimerDict.Keys)
         {
             list.Add(timeout);
         }
         for (int i = 0; i < list.Count; i++)
         {
             DateTime now                  = DateTime.Now;
             eTimeout timeout2             = list[i];
             HSMSTimer.CheckTimerPara para = this.otherTimerDict[timeout2];
             double num2 = (now - para.StartTime).TotalMilliseconds / 1000.0;
             if ((timeout2 == eTimeout.T6 && num2 > (double)this.t6Interval) || (timeout2 == eTimeout.T7 && num2 > (double)this.t7Interval) || (timeout2 == eTimeout.T8 && num2 > (double)this.t8Interval) || (timeout2 == eTimeout.LinkTest && num2 > (double)this.linkTestInterval))
             {
                 this.logger.Debug(string.Format("HSMSTimer::CheckOtherTimeout: {0}, {1}", num2, timeout2));
                 this.otherTimerDict.Remove(timeout2);
                 TimerPara para2 = new TimerPara
                 {
                     Type = timeout2,
                     Msg  = null
                 };
                 this.timeoutQueue.Enqueue(para2);
             }
             else if (timeout2 != eTimeout.T6 && timeout2 != eTimeout.T7 && timeout2 != eTimeout.T8 && timeout2 != eTimeout.LinkTest)
             {
                 this.logger.Debug(string.Format("CheckOtherTimeout: {0}-{1}", timeout2, num2));
             }
         }
     }
     catch (Exception exception)
     {
         this.logger.Error("CheckOtherTimeout: ", exception);
     }
 }
예제 #4
0
 public void StartT3Timer(SECSMessage msg)
 {
     if (msg != null)
     {
         try
         {
             lock (this.syncTimeout)
             {
                 HSMSTimer.CheckTimerPara para = new HSMSTimer.CheckTimerPara
                 {
                     SystemBytes = msg.SystemBytes,
                     msg         = msg,
                     StartTime   = DateTime.Now
                 };
                 this.t3TimerDict.Add(para.SystemBytes, para);
             }
             this.logger.Debug(string.Format("Timer::StartT3Timer, SystemBytes={0}", msg.SystemBytes));
         }
         catch (Exception exception)
         {
             this.logger.Error("Timer::StartT3Timer", exception);
         }
     }
 }