MessageIn Event
Fires when a message is received.
Syntax
public event OnMessageInHandler OnMessageIn; public delegate void OnMessageInHandler(object sender, StunMessageInEventArgs e); public class StunMessageInEventArgs : EventArgs { public int Method { get; } public bool Indication { get; } public string TransactionId { get; } public int ErrorCode { get; } public string ErrorMessage { get; } }
Public Event OnMessageIn As OnMessageInHandler Public Delegate Sub OnMessageInHandler(sender As Object, e As StunMessageInEventArgs) Public Class StunMessageInEventArgs Inherits EventArgs Public ReadOnly Property Method As Integer Public ReadOnly Property Indication As Boolean Public ReadOnly Property TransactionId As String Public ReadOnly Property ErrorCode As Integer Public ReadOnly Property ErrorMessage As String End Class
Remarks
This event fires anytime the component receives a message, be it an indication or a success/error response.
The Method parameter reflects the method of message received.
- 1 (BINDING)
- 2 (SHARED_SECRET)
- 3 (ALLOCATE)
- 4 (REFRESH)
- 6 (SEND)
- 7 (DATA)
- 8 (CREATEPERMISSION)
- 9 (CHANNELBIND)
The Indication parameter indicates whether the message is an indication (versus a success/error response).
The TransactionId parameter reflect's the message's transaction Id.
If the message is an error response, the ErrorCode and ErrorMessage will reflect the error information returned by the server; otherwise they will be 0 and empty string, respectively.