Noble Connect
Add relays and punchthrough to Mirror or UNet
NobleConnect.Stun.AttributeLong Class Reference

Any Attribute that just holds a string More...

Inherits NobleConnect.Stun.Attribute.

Public Member Functions

 AttributeLong (AttributeType attributeType, long value)
 Construct an AttributeString of the provided AttributeType using the provided string value. More...
 
 AttributeLong (AttributeType type, byte[] buffer, ref int offset)
 Construct an AttributeString from the provided byte array More...
 
override void SerializeValues (BufferView buffer, ReadOnlyByteArray transactionID)
 Transform the string into an ArraySegment of bytes to be sent over the network. More...
 
override ushort GetValueSize ()
 Get the serialized size of the attribute values More...
 
- Public Member Functions inherited from NobleConnect.Stun.Attribute
 Attribute (AttributeType type)
 Construct an Attribute of the provided AttributeType More...
 
 Attribute (AttributeType type, ref int offset)
 
void Serialize (BufferView buffer, ReadOnlyByteArray transactionID)
 Convert this attribute to a bunch of bytes and add them to the provided buffer More...
 
ushort GetSize ()
 

Public Attributes

readonly long value
 The string value More...
 
- Public Attributes inherited from NobleConnect.Stun.Attribute
readonly AttributeType attributeType
 The AttributeType of this Attribute More...
 

Additional Inherited Members

- Static Public Member Functions inherited from NobleConnect.Stun.Attribute
static ushort DeserializeLength (byte[] buffer, ref int offset)
 Read the Attribute length from a byte array. More...
 
static ushort GetNumPaddingBytes (int length)
 Calculate padding based on length More...
 
- Static Public Attributes inherited from NobleConnect.Stun.Attribute
const int HEADER_SIZE = 4
 

Detailed Description

Any Attribute that just holds a string

Constructor & Destructor Documentation

◆ AttributeLong() [1/2]

NobleConnect.Stun.AttributeLong.AttributeLong ( AttributeType  attributeType,
long  value 
)

Construct an AttributeString of the provided AttributeType using the provided string value.

This is called when constructing an Attribute to send to a Stun server.

Parameters
attributeType
value

◆ AttributeLong() [2/2]

NobleConnect.Stun.AttributeLong.AttributeLong ( AttributeType  type,
byte[]  buffer,
ref int  offset 
)

Construct an AttributeString from the provided byte array

This is called when deserializing an AttributeString received from a Stun server.

Parameters
type
buffer
offset

Member Function Documentation

◆ GetValueSize()

override ushort NobleConnect.Stun.AttributeLong.GetValueSize ( )
virtual

Get the serialized size of the attribute values

Returns
The byte length of the UTF8 encoded value string

Reimplemented from NobleConnect.Stun.Attribute.

◆ SerializeValues()

override void NobleConnect.Stun.AttributeLong.SerializeValues ( BufferView  buffer,
ReadOnlyByteArray  transactionID 
)
virtual

Transform the string into an ArraySegment of bytes to be sent over the network.

Uses UTF8 encoding

Reimplemented from NobleConnect.Stun.Attribute.

Member Data Documentation

◆ value

readonly long NobleConnect.Stun.AttributeLong.value

The string value