Exemplo n.º 1
0
 private static void ZeroUpDateTick(object sender)
 {
     try
     {
         ThreadTimerModel model = sender as ThreadTimerModel;
         model.startTime = DateTime.Now;
         while ((model.endTime - model.startTime).TotalMilliseconds < (double)(1000 * model.RunTime))
         {
             model.endTime = DateTime.Now;
             try
             {
                 if (!TcpCall.TestS2KFCommunication.SendData(ThreadTimerModel.MsgLen, true).IsReturn)
                 {
                     model.sendErrNum++;
                 }
                 else
                 {
                     model.sendSuNum++;
                 }
             }
             catch (Exception ex)
             {
                 LogManager.WriteException(ex.ToString());
                 Console.WriteLine("UpDateTick Exception");
             }
         }
         S2KFCommunication.SetEnd();
     }
     catch (Exception ex)
     {
         LogManager.WriteException(ex.ToString());
         Console.WriteLine("UpDateTick Exception");
     }
 }
Exemplo n.º 2
0
 private static void UpDateTick(object sender)
 {
     try
     {
         ReturnValue <string> msgData = TcpCall.TestS2KFCommunication.SendData(ThreadTimerModel.MsgLen, true);
         ThreadTimerModel     model   = sender as ThreadTimerModel;
         if (!msgData.IsReturn)
         {
             model.sendErrNum++;
         }
         else
         {
             model.sendSuNum++;
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteException(ex.ToString());
         Console.WriteLine("UpDateTick Exception");
     }
 }