protected void processPacket(ushort sequence, byte[] buffer, int length)
 {
     if (sequence == nextSequence || PacketIO.SequenceGreaterThan(sequence, nextSequence))
     {
         nextSequence = (ushort)(sequence + 1);
         ReceiveCallback(ChannelID, buffer, length);
     }
 }
Ejemplo n.º 2
0
 protected void processPacket(ushort sequence, byte[] buffer, int length)
 {
     // only process a packet if it is the next packet we expect, or it is newer.
     if (sequence == nextSequence || PacketIO.SequenceGreaterThan(sequence, nextSequence))
     {
         nextSequence = (ushort)(sequence + 1);
         ReceiveCallback(buffer, length);
     }
 }
Ejemplo n.º 3
0
        public T Insert(ushort sequence)
        {
            if (PacketIO.SequenceLessThan(sequence, (ushort)(this.sequence - numEntries)))
            {
                return((T)null);
            }
            if (PacketIO.SequenceGreaterThan((ushort)(sequence + 1), this.sequence))
            {
                RemoveEntries(this.sequence, sequence);
                this.sequence = (ushort)(sequence + 1);
            }
            int num = (int)sequence % numEntries;

            entrySequence[num] = sequence;
            return(entryData[num]);
        }
        public T Insert(ushort sequence)
        {
            if (PacketIO.SequenceLessThan(sequence, (ushort)(this.sequence - numEntries)))
            {
                return(null);
            }

            if (PacketIO.SequenceGreaterThan((ushort)(sequence + 1), this.sequence))
            {
                RemoveEntries(this.sequence, sequence);
                this.sequence = (ushort)(sequence + 1);
            }

            int index = sequence % numEntries;

            this.entrySequence[index] = sequence;
            return(this.entryData[index]);
        }