1
using System.Text;
2

3
namespace Libplanet.Stun.Attributes
4
{
5
    public class Software : Attribute
6
    {
7 1
        public Software(string value)
8 1
        {
9 1
            Value = value;
10 1
        }
11

12 1
        public override AttributeType Type => AttributeType.Software;
13

14 1
        public string Value { get; }
15

16
        internal static Software Parse(byte[] payload)
17 1
        {
18 1
            return new Software(Encoding.ASCII.GetString(payload));
19 1
        }
20

21
        protected override byte[] EncodePayload(byte[] transactionId)
22 1
        {
23 1
            return Encoding.ASCII.GetBytes(Value);
24 1
        }
25
    }
26
}

Read our documentation on viewing source code .

Loading