Represents the Class of a Message as defined in RFC 5389 Section 6 More...
Public Member Functions | |
MessageClass (ushort value) | |
Construct a MessageClass instance with the specified value More... | |
override string | ToString () |
Return a human-readable description of the MessageClass value More... | |
override bool | Equals (object obj) |
Compare two MesssageClass objects using their values More... | |
override int | GetHashCode () |
Calculate a hash for this MessageClass using the value. More... | |
Static Public Member Functions | |
static ushort | ParseClassValue (byte[] buffer, int bufferIndex) |
static bool | IsValidClass (ushort value) |
static implicit | operator ushort (MessageClass m) |
Cast a MessageClass to a ushort by returning the value More... | |
static bool | operator== (MessageClass a, MessageClass b) |
Compare two MessageClasses using their values More... | |
static bool | operator!= (MessageClass a, MessageClass b) |
Compare two MessageClasses using their values More... | |
Static Public Attributes | |
const ushort | REQUEST = 0 |
Value for request messages that expect a response More... | |
const ushort | INDICATION = 1 |
Value for indication messages that do not expect a response More... | |
const ushort | SUCCESS_RESPONSE = 2 |
Value for successful response message More... | |
const ushort | ERROR_RESPONSE = 3 |
Value for error response message More... | |
static readonly MessageClass | Request = new MessageClass(REQUEST) |
The Request MessageClass is used for Messages that expect a response. More... | |
static readonly MessageClass | Indication = new MessageClass(INDICATION) |
The Indication MessageClass is used for Messages that do not expect a response. More... | |
static readonly MessageClass | SuccessResponse = new MessageClass(SUCCESS_RESPONSE) |
The SuccessResponse MessageClass is used for response messages that indicate success. More... | |
static readonly MessageClass | ErrorResponse = new MessageClass(ERROR_RESPONSE) |
The ErrorResponse MessageClass is used for response messages that indicate failure. More... | |
Protected Attributes | |
readonly ushort | value |
The unsigned short value that this MessageClass represents. More... | |
Represents the Class of a Message as defined in RFC 5389 Section 6
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 MessageClass.
NobleConnect.Stun.MessageClass.MessageClass | ( | ushort | value | ) |
Construct a MessageClass instance with the specified value
value |
override bool NobleConnect.Stun.MessageClass.Equals | ( | object | obj | ) |
Compare two MesssageClass objects using their values
a | |
b |
override int NobleConnect.Stun.MessageClass.GetHashCode | ( | ) |
Calculate a hash for this MessageClass using the value.
|
static |
|
static |
Cast a MessageClass to a ushort by returning the value
m |
|
static |
Compare two MessageClasses using their values
a | |
b |
|
static |
Compare two MessageClasses using their values
a | |
b |
|
static |
override string NobleConnect.Stun.MessageClass.ToString | ( | ) |
Return a human-readable description of the MessageClass value
|
static |
Value for error response message
|
static |
The ErrorResponse MessageClass is used for response messages that indicate failure.
|
static |
Value for indication messages that do not expect a response
|
static |
The Indication MessageClass is used for Messages that do not expect a response.
|
static |
Value for request messages that expect a response
|
static |
The Request MessageClass is used for Messages that expect a response.
|
static |
Value for successful response message
|
static |
The SuccessResponse MessageClass is used for response messages that indicate success.
|
protected |
The unsigned short value that this MessageClass represents.