protected void ackPacket(ushort seq)
        {
            OutgoingPacketSet outgoingPacketSet = ackBuffer.Find(seq);

            if (outgoingPacketSet == null)
            {
                return;
            }
            for (int i = 0; i < outgoingPacketSet.MessageIds.Count; i++)
            {
                ushort num = outgoingPacketSet.MessageIds[i];
                if (sendBuffer.Exists(num))
                {
                    sendBuffer.Find(num).writeLock = true;
                    sendBuffer.Remove(num);
                }
            }
            bool   flag = true;
            ushort num2 = oldestUnacked;

            while (num2 == sequence || PacketIO.SequenceLessThan(num2, sequence))
            {
                if (sendBuffer.Exists(num2))
                {
                    oldestUnacked = num2;
                    flag          = false;
                    break;
                }
                num2 = (ushort)(num2 + 1);
            }
            if (flag)
            {
                oldestUnacked = sequence;
            }
        }
 protected void flushMessagePacker(bool bufferAck = true)
 {
     if (messagePacker.Length > 0)
     {
         ushort            num = packetController.SendPacket(messagePacker.InternalBuffer, messagePacker.Length, (byte)ChannelID);
         OutgoingPacketSet outgoingPacketSet = ackBuffer.Insert(num);
         outgoingPacketSet.MessageIds.Clear();
         outgoingPacketSet.MessageIds.AddRange(tempList);
         messagePacker.SetSize(0);
         tempList.Clear();
     }
 }