Exemple #1
0
 public void FillAttributesArray(List <STUNAttr> attributes)
 {
     buffer.Rewind();
     buffer.SkipBytes(STUNMessageBuilder.HEADER_LENGTH);
     while (buffer.Position < STUNMessageBuilder.HEADER_LENGTH + length)
     {
         STUNAttribute type;
         ushort        length;
         STUNTypeLengthValue.ReadTypeLength(ref buffer, out type, out length);
         STUNAttr attr = new STUNAttr(type, new ByteBuffer(buffer.data, buffer.absPosition, length), new ByteBuffer(buffer.data, buffer.absOffset, buffer.Length));
         buffer.Position += length;
         STUNTypeLengthValue.AddPadding(ref buffer);
         attributes.Add(attr);
     }
 }
Exemple #2
0
 public void FillAttributesArray(List <STUNAttr> attributes)
 {
     attributes.Clear();
     buffer.Position = STUNMessageBuilder.HEADER_LENGTH;
     while (buffer.Position < STUNMessageBuilder.HEADER_LENGTH + length)
     {
         var attr = new STUNAttr(ref buffer);
         if (attr.isValid)
         {
             attributes.Add(attr);
         }
         else
         {
             return;
         }
     }
 }