예제 #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");
     }
 }
예제 #2
0
 public static void SetEnd()
 {
     S2KFCommunication.endNum++;
     if (S2KFCommunication.endNum == S2KFCommunication.objList.Count)
     {
         S2KFCommunication.stop(null);
     }
 }