Noble Connect
Add relays and punchthrough to Mirror or UNet
NobleConnect.Turn.MessageMethod Class Reference

Represents the Method of a Turn Message as defined in RFC 5766 Section 13 More...

Inherits NobleConnect.Stun.MessageMethod.

Public Member Functions

 MessageMethod (ushort value)
 Construct a MessageMethod instance with the specified value More...
 
override string ToString ()
 Return a human-readable description of the MessageMethod value More...
 
- Public Member Functions inherited from NobleConnect.Stun.MessageMethod
 MessageMethod (ushort value)
 Construct a MessageMethod instance with the specified value More...
 
override string ToString ()
 Return a human-readable description of the MessageMethod value More...
 
override bool Equals (object obj)
 Compare two MessageMethod objects using their values More...
 
override int GetHashCode ()
 Calculate a hash for this MessageClass using the value. More...
 

Static Public Member Functions

new static bool IsValidMethod (ushort value)
 
- Static Public Member Functions inherited from NobleConnect.Stun.MessageMethod
static ushort ParseMethodValue (byte[] buffer, int bufferIndex)
 
static bool IsValidMethod (ushort value)
 
static implicit operator ushort (MessageMethod m)
 Cast a MessageMethod to a ushort by returning the value More...
 
static bool operator== (MessageMethod a, MessageMethod b)
 Compare two MessageMethods using their values More...
 
static bool operator!= (MessageMethod a, MessageMethod b)
 Compare two MessageMethods using their values More...
 

Static Public Attributes

const ushort ALLOCATE = 0x003
 Value for relay allocation messages More...
 
const ushort REFRESH = 0x004
 Value for messages used to refresh an allocation More...
 
const ushort SEND = 0x006
 Value for messages used to send data from a client to a peer over a relay More...
 
const ushort DATA = 0x007
 Value for a messages that contain data from a peer that arrived from a relay More...
 
const ushort CREATE_PERMISSION = 0x008
 Value for messages used for installing permissions that allow communication between a client and a peer More...
 
const ushort CHANNEL_BIND = 0x009
 Value for creating a channel binding to send and receive data more efficiently More...
 
static readonly MessageMethod Allocate = new MessageMethod(ALLOCATE)
 The Allocate MessageMethod is used for sending a message to request an relay allocation on the Turn server More...
 
static readonly MessageMethod Refresh = new MessageMethod(REFRESH)
 The Refresh MessageMethod is used for sending a message to refresh an allocation on the Turn server More...
 
static readonly MessageMethod Send = new MessageMethod(SEND)
 The Send MessageMethod is used for sending data that will be relayed to a peer More...
 
static readonly MessageMethod Data = new MessageMethod(DATA)
 The Data MessageMethod is used for receiving data from a peer More...
 
static readonly MessageMethod CreatePermission = new MessageMethod(CREATE_PERMISSION)
 The CreatePermission MessageMethod is used for installing permissions that allow communication between a client and a peer More...
 
static readonly MessageMethod ChannelBind = new MessageMethod(CHANNEL_BIND)
 The CreatePermission MessageMethod is used for creating a channel binding to send and receive data more efficiently More...
 
- Static Public Attributes inherited from NobleConnect.Stun.MessageMethod
const ushort BIND = 1
 Value for messages related to binding More...
 
static readonly MessageMethod Bind = new MessageMethod(BIND)
 The Bind MessageMethod is used for Messages related to binding. More...
 

Additional Inherited Members

- Public Attributes inherited from NobleConnect.Stun.MessageMethod
readonly ushort value
 The unsigned short value that this MessageMethod represents. More...
 

Detailed Description

Represents the Method of a Turn Message as defined in RFC 5766 Section 13

I would have preferred this to be an enum, but it needs to be extendable for Turn and Ice. So instead it is this weird enum-like class that exposes static instances of itself for each different MessageMethod.

Constructor & Destructor Documentation

◆ MessageMethod()

NobleConnect.Turn.MessageMethod.MessageMethod ( ushort  value)

Construct a MessageMethod instance with the specified value

Parameters
value

Member Function Documentation

◆ IsValidMethod()

new static bool NobleConnect.Turn.MessageMethod.IsValidMethod ( ushort  value)
static

◆ ToString()

override string NobleConnect.Turn.MessageMethod.ToString ( )

Return a human-readable description of the MessageMethod value

Returns

Member Data Documentation

◆ ALLOCATE

const ushort NobleConnect.Turn.MessageMethod.ALLOCATE = 0x003
static

Value for relay allocation messages

◆ Allocate

readonly MessageMethod NobleConnect.Turn.MessageMethod.Allocate = new MessageMethod(ALLOCATE)
static

The Allocate MessageMethod is used for sending a message to request an relay allocation on the Turn server

◆ CHANNEL_BIND

const ushort NobleConnect.Turn.MessageMethod.CHANNEL_BIND = 0x009
static

Value for creating a channel binding to send and receive data more efficiently

◆ ChannelBind

readonly MessageMethod NobleConnect.Turn.MessageMethod.ChannelBind = new MessageMethod(CHANNEL_BIND)
static

The CreatePermission MessageMethod is used for creating a channel binding to send and receive data more efficiently

◆ CREATE_PERMISSION

const ushort NobleConnect.Turn.MessageMethod.CREATE_PERMISSION = 0x008
static

Value for messages used for installing permissions that allow communication between a client and a peer

◆ CreatePermission

readonly MessageMethod NobleConnect.Turn.MessageMethod.CreatePermission = new MessageMethod(CREATE_PERMISSION)
static

The CreatePermission MessageMethod is used for installing permissions that allow communication between a client and a peer

◆ DATA

const ushort NobleConnect.Turn.MessageMethod.DATA = 0x007
static

Value for a messages that contain data from a peer that arrived from a relay

◆ Data

readonly MessageMethod NobleConnect.Turn.MessageMethod.Data = new MessageMethod(DATA)
static

The Data MessageMethod is used for receiving data from a peer

◆ REFRESH

const ushort NobleConnect.Turn.MessageMethod.REFRESH = 0x004
static

Value for messages used to refresh an allocation

◆ Refresh

readonly MessageMethod NobleConnect.Turn.MessageMethod.Refresh = new MessageMethod(REFRESH)
static

The Refresh MessageMethod is used for sending a message to refresh an allocation on the Turn server

◆ SEND

const ushort NobleConnect.Turn.MessageMethod.SEND = 0x006
static

Value for messages used to send data from a client to a peer over a relay

◆ Send

readonly MessageMethod NobleConnect.Turn.MessageMethod.Send = new MessageMethod(SEND)
static

The Send MessageMethod is used for sending data that will be relayed to a peer