Noble Connect
Add relays and punchthrough to Mirror or UNet
NobleConnect.Sdp.Message Class Reference

A message that holds an SdpMessage More...

Inherits NobleConnect.IMessage.

Public Member Functions

 Message (MessageType messageType, SdpMessage payload)
 
 Message (MessageType messageType, SdpMessage payload, ReadOnlyByteArray transactionID)
 
 Message (byte[] response, int index, int count)
 Construct a message from some bytes More...
 
void Serialize (BufferView buffer)
 Serialize the message to a buffer More...
 
byte[] AsBytes ()
 
override string ToString ()
 Get a human readable representation of the Message More...
 

Static Public Member Functions

static bool IsSDPMessage (byte[] buffer, int index, int count)
 Determine whether or not some bytes look like an sdp message More...
 
static ReadOnlyByteArray NextTransactionID ()
 Get a fresh transaction ID More...
 

Public Attributes

MessageType messageType
 
SdpMessage payload
 

Properties

override ReadOnlyByteArray TransactionID [get]
 
- Properties inherited from NobleConnect.IMessage
abstract ReadOnlyByteArray TransactionID [get]
 

Detailed Description

A message that holds an SdpMessage

Message format is:

Message header: 6 bytes 4 for cookie 1 for message type 1 for transaction id

Sdp header: 40 or 52 bytes 1 for is IPv6 4 or 16 for address 2 for port 16 for username guid 16 for password guid 1 for number of candidates

Candidates: 24 or 36 or 42 bytes per candidate 16 for foundation 1 for local preference 1 for candidateType, isIPv6, and isDualStack 4 or 16 for address 2 for port (4 or 16 for address) (2 for port)

Constructor & Destructor Documentation

◆ Message() [1/3]

NobleConnect.Sdp.Message.Message ( MessageType  messageType,
SdpMessage  payload 
)

◆ Message() [2/3]

NobleConnect.Sdp.Message.Message ( MessageType  messageType,
SdpMessage  payload,
ReadOnlyByteArray  transactionID 
)

◆ Message() [3/3]

NobleConnect.Sdp.Message.Message ( byte[]  response,
int  index,
int  count 
)

Construct a message from some bytes

Parameters
response
index
count

Member Function Documentation

◆ AsBytes()

byte [] NobleConnect.Sdp.Message.AsBytes ( )

◆ IsSDPMessage()

static bool NobleConnect.Sdp.Message.IsSDPMessage ( byte[]  buffer,
int  index,
int  count 
)
static

Determine whether or not some bytes look like an sdp message

Size of message must be large enough for header and at least one candidate of maximum size (the dual stack relay). Cookie must match, message type and isIPv6 byte must be valid. Remaining message size must be sane given number of candidates. First candidate must look valid

Parameters
buffer
index
count
Returns

◆ NextTransactionID()

static ReadOnlyByteArray NobleConnect.Sdp.Message.NextTransactionID ( )
static

Get a fresh transaction ID

Returns

◆ Serialize()

void NobleConnect.Sdp.Message.Serialize ( BufferView  buffer)

Serialize the message to a buffer

Parameters
buffer

◆ ToString()

override string NobleConnect.Sdp.Message.ToString ( )

Get a human readable representation of the Message

This is not what is sent over the network. Just useful for debugging.

Returns

Member Data Documentation

◆ messageType

MessageType NobleConnect.Sdp.Message.messageType

◆ payload

SdpMessage NobleConnect.Sdp.Message.payload

Property Documentation

◆ TransactionID

override ReadOnlyByteArray NobleConnect.Sdp.Message.TransactionID
get