-
- All Implemented Interfaces:
public class RawMessageThe class represents a binary STUN message as well as the address and port of the host that sent it and the address and port where it was received (locally).
-
-
Field Summary
Fields Modifier and Type Field Description private final intmessageLengthprivate final TransportAddressremoteAddressprivate final TransportAddresslocalAddress
-
Method Summary
Modifier and Type Method Description intgetMessageLength()Returns the message length. TransportAddressgetRemoteAddress()Returns the address and port of the host that sent the message TransportAddressgetLocalAddress()Returns the address that this message was received on. Array<byte>getBytes()Returns the message itself. static RawMessagebuild(Array<byte> messageBytes, int messageLength, TransportAddress remoteAddress, TransportAddress localAddress)Use builder pattern to allow creation of immutable RawMessage instances, from outside the current package. -
-
Method Detail
-
getMessageLength
int getMessageLength()
Returns the message length.
-
getRemoteAddress
TransportAddress getRemoteAddress()
Returns the address and port of the host that sent the message
-
getLocalAddress
TransportAddress getLocalAddress()
Returns the address that this message was received on.
-
build
static RawMessage build(Array<byte> messageBytes, int messageLength, TransportAddress remoteAddress, TransportAddress localAddress)
Use builder pattern to allow creation of immutable RawMessage instances, from outside the current package.
- Parameters:
messageBytes- the message itself.messageLength- the number of bytes currently stored in the messageBytes array.remoteAddress- the address where the message came from.localAddress- the TransportAddress that the message was received on.
-
-
-
-