void CheckThread_Method() { while (IsInSending) { Thread.Sleep(500); for (int i = 0; i < NeedReply.Count; i++) { SendActor item = NeedReply[i]; LogHelper.Log(item.udpd.udp_MesageID + "::" + item.udpd.SendCout); if (item.udpd.SendCout > 3) { NeedReply.RemoveAt(i); } else { SendQueue.Enqueue(item); } } } }
void SendThread_Method() { while (IsInSending) { Thread.Sleep(10); lock (lockobj) { if (SendQueue.Count > 0) { SendActor tm = SendQueue.Dequeue(); if (tm.udpd.NeedReply) { tm.udpd.SendCout++; if (!NeedReply.Contains(tm)) { tm.udpd.udp_MesageID = mMessageID.GetID(); NeedReply.Add(tm); } } RealMUSPSend(tm.HostName, tm.udpd); } } } }