Class ErrorCodeAttribute
The ERROR-CODE attribute is used in error response messages. It contains a numeric error code value in the range of 300 to 699 plus a textual reason phrase encoded in UTF-8 [RFC3629], and is consistent in its code assignments and semantics with SIP [RFC3261] and HTTP [RFC2616]. The reason phrase is meant for user consumption, and can be anything appropriate for the error code. Recommended reason phrases for the defined error codes are included in the IANA registry for error codes. The reason phrase MUST be a UTF-8 [RFC3629] encoded sequence of less than 128 characters (which can be as long as 763 bytes).
Inherited Members
Namespace: FM.LiveSwitch.Stun
Assembly: FM.LiveSwitch.dll
Syntax
public class ErrorCodeAttribute : Attribute
Constructors
ErrorCodeAttribute(Int32)
Initializes a new instance of the ErrorCodeAttribute class.
Declaration
public ErrorCodeAttribute(int code)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | code | The error code. |
ErrorCodeAttribute(Int32, String)
Initializes a new instance of the ErrorCodeAttribute class.
Declaration
public ErrorCodeAttribute(int code, string reason)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | code | The error code. |
| System.String | reason | The error reason. |
Properties
Code
Gets or sets the error code.
Declaration
public int Code { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The code. |
Reason
Gets or sets the error reason.
Declaration
public string Reason { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The reason. |
TypeValue
Gets the type value.
Declaration
public override int TypeValue { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Overrides
Methods
GetValueLength()
Gets the length of the attribute value.
Declaration
protected override int GetValueLength()
Returns
| Type | Description |
|---|---|
| System.Int32 |
Overrides
ReadValueFrom(DataBuffer, Int32, Int32)
Initializes a new instance of the ErrorCodeAttribute class.
Declaration
public static ErrorCodeAttribute ReadValueFrom(DataBuffer buffer, int offset, int length)
Parameters
| Type | Name | Description |
|---|---|---|
| DataBuffer | buffer | The buffer. |
| System.Int32 | offset | The offset. |
| System.Int32 | length | The length. |
Returns
| Type | Description |
|---|---|
| ErrorCodeAttribute |
ToString()
Returns a string that represents this instance.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | A string that represents this instance. |
Overrides
WriteValueTo(DataBuffer, Int32)
Writes the attribute value to a data buffer.
Declaration
protected override void WriteValueTo(DataBuffer buffer, int offset)
Parameters
| Type | Name | Description |
|---|---|---|
| DataBuffer | buffer | The buffer. |
| System.Int32 | offset | The offset. |