MessageIn Event
Fires when a message is received.
Syntax
public open class DefaultStunEventListener : StunEventListener { ... public override fun messageIn(e: StunMessageInEvent) {} ... } public class StunMessageInEvent { val method: Int val indication: Boolean val transactionId: String? val errorCode: Int val errorMessage: String? }
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.