Exemplo n.º 1
0
            protected override byte[] processMessage(UnPacker unPacker)
            {
                int flags = unPacker.UnpackByte();
                int accnum = unPacker.UnpackInteger();

                if ((flags & ACK_BIT) == ACK_BIT)
                {
                    connection.reliableTimer.removeResender(accnum);
                    return null;
                }
                else
                {
                    sendAckMessage(accnum);
                    return processRecivedMessage(unPacker, accnum);
                }
            }
Exemplo n.º 2
0
 private int UnpackID(UnPacker unpacker)
 {
     if (this.nextID < sbyte.MaxValue)
     {
         return unpacker.UnpackByte();
     }
     else if (this.nextID < short.MaxValue)
     {
         return unpacker.UnpackShort();
     }
     else
     {
         return unpacker.UnpackInteger();
     }
 }
Exemplo n.º 3
0
 protected override byte[] processMessage(UnPacker unPacker)
 {
     unPacker.UnpackByte();
     int seqNum = unPacker.UnpackInteger();
     if (seqNum < lastRecivedSequenceNumber)
     {
         return null; //Discard the message if it is old.
     }
     else
     {
         lastRecivedSequenceNumber = seqNum;
         return unPacker.UnpackByteArray(unPacker.remaining());
     }
 }