Class Message
A STUN message.
Inheritance
Namespace: FM.LiveSwitch.Stun
Assembly: FM.LiveSwitch.dll
Syntax
public abstract class Message : object
Constructors
Message(MessageType, DataBuffer)
Initializes a new instance of the Message class.
Declaration
protected Message(MessageType messageType, DataBuffer transactionId)
Parameters
Type | Name | Description |
---|---|---|
MessageType | messageType | The type of the message. |
DataBuffer | transactionId | The transaction ID. |
Properties
AllocateMethod
Gets the allocate method.
Declaration
public static int AllocateMethod { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Attributes
Gets the message attributes.
Declaration
public Attribute[] Attributes { get; }
Property Value
Type | Description |
---|---|
Attribute[] |
BindingMethod
Gets the binding method.
Declaration
public static int BindingMethod { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
ChannelBindMethod
Gets the channel-bind method.
Declaration
public static int ChannelBindMethod { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
ConnectionAttemptMethod
Gets the connection-attempt method.
Declaration
public static int ConnectionAttemptMethod { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
ConnectionBindMethod
Gets the connection-bind method.
Declaration
public static int ConnectionBindMethod { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
ConnectMethod
Gets the connect method.
Declaration
public static int ConnectMethod { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
CreatePermissionMethod
Gets the create-permission method.
Declaration
public static int CreatePermissionMethod { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
DataMethod
Gets the data method.
Declaration
public static int DataMethod { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
MagicCookieBytes
Gets the "magic cookie" bytes.
Declaration
public static byte[] MagicCookieBytes { get; }
Property Value
Type | Description |
---|---|
System.Byte[] |
MagicCookieValue
Gets the "magic cookie" value.
Declaration
public static long MagicCookieValue { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
MessageType
Gets the message type.
Declaration
public MessageType MessageType { get; }
Property Value
Type | Description |
---|---|
MessageType |
Method
Gets the method.
Declaration
public abstract int Method { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
RefreshMethod
Gets the refresh method.
Declaration
public static int RefreshMethod { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
SendMethod
Gets the send method.
Declaration
public static int SendMethod { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
TransactionId
Gets the transaction ID.
Declaration
public DataBuffer TransactionId { get; }
Property Value
Type | Description |
---|---|
DataBuffer |
Methods
CreateMessage(Int32, MessageType, DataBuffer)
Creates a message.
Declaration
public static Message CreateMessage(int method, MessageType messageType, DataBuffer transactionId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | method | The method. |
MessageType | messageType | Type of the message. |
DataBuffer | transactionId | The transaction ID. |
Returns
Type | Description |
---|---|
Message |
GenerateTransactionId()
Generates a random transaction ID.
Declaration
protected static DataBuffer GenerateTransactionId()
Returns
Type | Description |
---|---|
DataBuffer |
GetAlternateServer()
Gets the alternate-server attribute.
Declaration
public AlternateServerAttribute GetAlternateServer()
Returns
Type | Description |
---|---|
AlternateServerAttribute |
GetChannelNumber()
Gets the channel-number attribute.
Declaration
public ChannelNumberAttribute GetChannelNumber()
Returns
Type | Description |
---|---|
ChannelNumberAttribute |
GetConnectionId()
Gets the connection-id attribute.
Declaration
public ConnectionIdAttribute GetConnectionId()
Returns
Type | Description |
---|---|
ConnectionIdAttribute |
GetData()
Gets the data attribute.
Declaration
public DataAttribute GetData()
Returns
Type | Description |
---|---|
DataAttribute |
GetDontFragment()
Gets the don't-fragment attribute.
Declaration
public DontFragmentAttribute GetDontFragment()
Returns
Type | Description |
---|---|
DontFragmentAttribute |
GetErrorCode()
Gets the error-code attribute.
Declaration
public ErrorCodeAttribute GetErrorCode()
Returns
Type | Description |
---|---|
ErrorCodeAttribute |
GetEvenPort()
Gets the even-port attribute.
Declaration
public EvenPortAttribute GetEvenPort()
Returns
Type | Description |
---|---|
EvenPortAttribute |
GetFingerprint()
Gets the fingerprint attribute.
Declaration
public FingerprintAttribute GetFingerprint()
Returns
Type | Description |
---|---|
FingerprintAttribute |
GetIceControlled()
Gets the ICE-controlled attribute.
Declaration
public ControlledAttribute GetIceControlled()
Returns
Type | Description |
---|---|
ControlledAttribute |
GetIceControlling()
Gets the ICE-controlling attribute.
Declaration
public ControllingAttribute GetIceControlling()
Returns
Type | Description |
---|---|
ControllingAttribute |
GetLength()
Gets the length of the message.
Declaration
public int GetLength()
Returns
Type | Description |
---|---|
System.Int32 |
GetLifetime()
Gets the lifetime attribute.
Declaration
public LifetimeAttribute GetLifetime()
Returns
Type | Description |
---|---|
LifetimeAttribute |
GetMappedAddress()
Gets the mapped-address attribute.
Declaration
public MappedAddressAttribute GetMappedAddress()
Returns
Type | Description |
---|---|
MappedAddressAttribute |
GetMessageIntegrity()
Gets the message-integrity attribute.
Declaration
public MessageIntegrityAttribute GetMessageIntegrity()
Returns
Type | Description |
---|---|
MessageIntegrityAttribute |
GetNonce()
Gets the nonce attribute.
Declaration
public NonceAttribute GetNonce()
Returns
Type | Description |
---|---|
NonceAttribute |
GetPayloadLength()
Gets the length of the payload.
Declaration
public int GetPayloadLength()
Returns
Type | Description |
---|---|
System.Int32 |
GetPriority()
Gets the priority attribute.
Declaration
public PriorityAttribute GetPriority()
Returns
Type | Description |
---|---|
PriorityAttribute |
GetRealm()
Gets the realm attribute.
Declaration
public RealmAttribute GetRealm()
Returns
Type | Description |
---|---|
RealmAttribute |
GetRequestedAddressFamily()
Gets the requested-address-family attribute.
Declaration
public RequestedAddressFamilyAttribute GetRequestedAddressFamily()
Returns
Type | Description |
---|---|
RequestedAddressFamilyAttribute |
GetRequestedTransport()
Gets the requested-transport attribute.
Declaration
public RequestedTransportAttribute GetRequestedTransport()
Returns
Type | Description |
---|---|
RequestedTransportAttribute |
GetReservationToken()
Gets the reservation-token attribute.
Declaration
public ReservationTokenAttribute GetReservationToken()
Returns
Type | Description |
---|---|
ReservationTokenAttribute |
GetSoftware()
Gets the software attribute.
Declaration
public SoftwareAttribute GetSoftware()
Returns
Type | Description |
---|---|
SoftwareAttribute |
GetTransactionTransmitCounter()
Gets the transaction-transmit-counter attribute.
Declaration
public TransactionTransmitCounterAttribute GetTransactionTransmitCounter()
Returns
Type | Description |
---|---|
TransactionTransmitCounterAttribute |
GetUnknownAttributes()
Gets the unknown-attributes attribute.
Declaration
public UnknownAttributesAttribute GetUnknownAttributes()
Returns
Type | Description |
---|---|
UnknownAttributesAttribute |
GetUseCandidate()
Gets the use-candidate attribute.
Declaration
public UseCandidateAttribute GetUseCandidate()
Returns
Type | Description |
---|---|
UseCandidateAttribute |
GetUsername()
Gets the username attribute.
Declaration
public UsernameAttribute GetUsername()
Returns
Type | Description |
---|---|
UsernameAttribute |
GetXorMappedAddress()
Gets the XOR-mapped-address attribute.
Declaration
public XorMappedAddressAttribute GetXorMappedAddress()
Returns
Type | Description |
---|---|
XorMappedAddressAttribute |
GetXorPeerAddress()
Gets the XOR-peer-address attribute.
Declaration
public XorPeerAddressAttribute GetXorPeerAddress()
Returns
Type | Description |
---|---|
XorPeerAddressAttribute |
GetXorRelayedAddress()
Gets the XOR-relayed-address attribute.
Declaration
public XorRelayedAddressAttribute GetXorRelayedAddress()
Returns
Type | Description |
---|---|
XorRelayedAddressAttribute |
ReadFrom(DataBuffer)
Reads a Message instance from a buffer.
Declaration
public static Message ReadFrom(DataBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | buffer | The buffer. |
Returns
Type | Description |
---|---|
Message |
ReadFrom(DataBuffer, Int32)
Reads a Message instance from a buffer.
Declaration
public static Message ReadFrom(DataBuffer buffer, int offset)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | buffer | The buffer. |
System.Int32 | offset | The offset. |
Returns
Type | Description |
---|---|
Message |
ReadFrom(DataBuffer, Int32, out Int32)
Reads an Message instance from a buffer.
Declaration
public static Message ReadFrom(DataBuffer buffer, int offset, out int length)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | buffer | The buffer. |
System.Int32 | offset | The offset. |
System.Int32 | length | The length of the parsed segment. |
Returns
Type | Description |
---|---|
Message |
SetAlternateServer(AlternateServerAttribute)
Set the alternate-server attribute.
Declaration
public void SetAlternateServer(AlternateServerAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
AlternateServerAttribute | attribute | The alternate-server attribute. |
SetChannelNumber(ChannelNumberAttribute)
Sets the channel-number attribute.
Declaration
public void SetChannelNumber(ChannelNumberAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
ChannelNumberAttribute | attribute | The channel-number attribute. |
SetConnectionId(ConnectionIdAttribute)
Sets the connection-id attribute.
Declaration
public void SetConnectionId(ConnectionIdAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
ConnectionIdAttribute | attribute | The connection-id attribute. |
SetData(DataAttribute)
Sets the data attribute.
Declaration
public void SetData(DataAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
DataAttribute | attribute | The data attribute. |
SetDontFragment(DontFragmentAttribute)
Sets the don't-fragment attribute.
Declaration
public void SetDontFragment(DontFragmentAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
DontFragmentAttribute | attribute | The don't-fragment attribute. |
SetErrorCode(ErrorCodeAttribute)
Set the error-code attribute.
Declaration
public void SetErrorCode(ErrorCodeAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
ErrorCodeAttribute | attribute | The error-code attribute. |
SetEvenPort(EvenPortAttribute)
Sets the even-port attribute.
Declaration
public void SetEvenPort(EvenPortAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
EvenPortAttribute | attribute | The even-port attribute. |
SetFingerprint(FingerprintAttribute)
Set the fingerprint attribute.
Declaration
public void SetFingerprint(FingerprintAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
FingerprintAttribute | attribute | The fingerprint attribute. |
SetIceControlled(ControlledAttribute)
Sets the ICE-controlled attribute.
Declaration
public void SetIceControlled(ControlledAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
ControlledAttribute | attribute | The ICE-controlled attribute. |
SetIceControlling(ControllingAttribute)
Sets the ICE-controlling attribute.
Declaration
public void SetIceControlling(ControllingAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
ControllingAttribute | attribute | The ICE-controlling attribute. |
SetLifetime(LifetimeAttribute)
Sets the lifetime attribute.
Declaration
public void SetLifetime(LifetimeAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
LifetimeAttribute | attribute | The lifetime attribute. |
SetMappedAddress(MappedAddressAttribute)
Set the mapped-address attribute.
Declaration
public void SetMappedAddress(MappedAddressAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
MappedAddressAttribute | attribute | The mapped-address attribute. |
SetMessageIntegrity(MessageIntegrityAttribute)
Set the message-integrity attribute.
Declaration
public void SetMessageIntegrity(MessageIntegrityAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
MessageIntegrityAttribute | attribute | The message-integrity attribute. |
SetNonce(NonceAttribute)
Set the nonce attribute.
Declaration
public void SetNonce(NonceAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
NonceAttribute | attribute | The nonce attribute. |
SetPriority(PriorityAttribute)
Sets the priority attribute.
Declaration
public void SetPriority(PriorityAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
PriorityAttribute | attribute | The priority attribute. |
SetRealm(RealmAttribute)
Set the realm attribute.
Declaration
public void SetRealm(RealmAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
RealmAttribute | attribute | The realm attribute. |
SetRequestedAddressFamily(RequestedAddressFamilyAttribute)
Sets the requested-address-family attribute.
Declaration
public void SetRequestedAddressFamily(RequestedAddressFamilyAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
RequestedAddressFamilyAttribute | attribute | The requested-address-family attribute. |
SetRequestedTransport(RequestedTransportAttribute)
Sets the requested-transport attribute.
Declaration
public void SetRequestedTransport(RequestedTransportAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
RequestedTransportAttribute | attribute | The requested-transport attribute. |
SetReservationToken(ReservationTokenAttribute)
Sets the reservation-token attribute.
Declaration
public void SetReservationToken(ReservationTokenAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
ReservationTokenAttribute | attribute | The reservation-token attribute. |
SetSoftware(SoftwareAttribute)
Set the software attribute.
Declaration
public void SetSoftware(SoftwareAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
SoftwareAttribute | attribute | The software attribute. |
SetTransactionTransmitCounter(TransactionTransmitCounterAttribute)
Set the transaction-transmit-counter attribute.
Declaration
public void SetTransactionTransmitCounter(TransactionTransmitCounterAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
TransactionTransmitCounterAttribute | attribute | The transaction-transmit-counter attribute. |
SetUnknownAttributes(UnknownAttributesAttribute)
Set the unknown-attributes attribute.
Declaration
public void SetUnknownAttributes(UnknownAttributesAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
UnknownAttributesAttribute | attribute | The unknown-attributes attribute. |
SetUseCandidate(UseCandidateAttribute)
Sets the use-candidate attribute.
Declaration
public void SetUseCandidate(UseCandidateAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
UseCandidateAttribute | attribute | The use-candidate attribute. |
SetUsername(UsernameAttribute)
Set the username attribute.
Declaration
public void SetUsername(UsernameAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
UsernameAttribute | attribute | The username attribute. |
SetXorMappedAddress(XorMappedAddressAttribute)
Set the XOR-mapped-address attribute.
Declaration
public void SetXorMappedAddress(XorMappedAddressAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
XorMappedAddressAttribute | attribute | The XOR-mapped-address attribute. |
SetXorPeerAddress(XorPeerAddressAttribute)
Sets the XOR-peer-address attribute.
Declaration
public void SetXorPeerAddress(XorPeerAddressAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
XorPeerAddressAttribute | attribute | The XOR-peer-address attribute. |
SetXorRelayedAddress(XorRelayedAddressAttribute)
Sets the XOR-relayed-address attribute.
Declaration
public void SetXorRelayedAddress(XorRelayedAddressAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
XorRelayedAddressAttribute | attribute | The XOR-relayed-address attribute. |
WriteTo(DataBuffer)
Writes the message to a data buffer.
Declaration
public void WriteTo(DataBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | buffer | The buffer. |
WriteTo(DataBuffer, Int32)
Writes the message to a data buffer.
Declaration
public void WriteTo(DataBuffer buffer, int offset)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | buffer | The buffer. |
System.Int32 | offset | The offset. |
WriteTo(DataBuffer, Int32, out Int32)
Writes the message to a data buffer.
Declaration
public void WriteTo(DataBuffer buffer, int offset, out int offsetPlus)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | buffer | The buffer. |
System.Int32 | offset | The offset. |
System.Int32 | offsetPlus | The offset plus the value length. |