MessageIn Event

Fires when a message is received.

Syntax

public class DefaultStunEventListener implements StunEventListener {
  ...
  public void messageIn(StunMessageInEvent e) {}
  ...
}

public class StunMessageInEvent {
  public int method;
  public boolean indication;
  public String transactionId;
  public int errorCode;
  public String errorMessage;
}

Remarks

This event fires anytime the class 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.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks P2P 2020 Java Edition - Version 20.0 [Build 8235]