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