/// <summary> /// 清除数据 /// </summary> public void Clear() { //回收所以数据 for (int i = 0; i < SendBuffer.Count; i++) { QueuePool.Roll(SendBuffer[i].Data); } SendBuffer.Clear(); }
/// <summary> /// 接收确认包 /// </summary> /// <param name="package"></param> public void AddAck(ACKPackage package) { var seqPack = SendBuffer.Find(x => x.PackSeq == package.PackSeq); if (seqPack != null) { SendBuffer.Remove(seqPack); QueuePool.Roll(seqPack.Data);//回收数据 } }