Package org.somda.sdc.dpws.udp
Class UdpMessage
java.lang.Object
org.somda.sdc.dpws.udp.UdpMessage
Raw UDP message packed as a byte array plus a length attribute and receiver information.
-
Constructor Summary
ConstructorsConstructorDescriptionUdpMessage(byte[] data, int length) Constructor without transport information.UdpMessage(byte[] data, int length, CommunicationContext communicationContext) Constructor with transport information. -
Method Summary
-
Constructor Details
-
UdpMessage
Constructor with transport information.- Parameters:
data- the payload of the UDP message.length- the actual message length.communicationContext- message transport and application information.
-
UdpMessage
public UdpMessage(byte[] data, int length) Constructor without transport information.Transport information is not required in case this message is used with multicast.
- Parameters:
data- the payload of the UDP message.length- the actual message length.
-
-
Method Details
-
hasTransportData
public boolean hasTransportData()Checks if there is transport data attached to the message.- Returns:
- true if there is a host and port, otherwise false.
-
getPort
-
getHost
-
getLength
public int getLength() -
getData
public byte[] getData()Gets the data from this object as byte array.Do not rely on the byte array's length attribute, retrieve the length via
getLength()instead!- Returns:
- message byte array.
-
getCommunicationContext
Returns the communication context stored in this message.- Returns:
- communication context containing transport information and more.
-
toString
-