public class DatagramPacketMessageMapper extends java.lang.Object implements InboundMessageMapper<java.net.DatagramPacket>, OutboundMessageMapper<java.net.DatagramPacket>
setCharset(String)
method.
By default, the UDP messages will be unreliable (truncation may occur on
the receiving end; packets may be lost).
Reliability can be enhanced by one or both of the following techniques:
Constructor and Description |
---|
DatagramPacketMessageMapper() |
Modifier and Type | Method and Description |
---|---|
java.net.DatagramPacket |
fromMessage(Message<?> message)
Raw byte[] from message, possibly with a length field up front.
|
void |
setAckAddress(java.lang.String ackAddress) |
void |
setAcknowledge(boolean acknowledge) |
void |
setCharset(java.lang.String charset) |
void |
setLengthCheck(boolean lengthCheck) |
void |
setLookupHost(boolean lookupHost) |
Message<byte[]> |
toMessage(java.net.DatagramPacket packet) |
public void setCharset(java.lang.String charset)
public void setAcknowledge(boolean acknowledge)
public void setAckAddress(java.lang.String ackAddress)
public void setLengthCheck(boolean lengthCheck)
public void setLookupHost(boolean lookupHost)
lookupHost
- the lookupHost to setpublic java.net.DatagramPacket fromMessage(Message<?> message) throws java.lang.Exception
fromMessage
in interface OutboundMessageMapper<java.net.DatagramPacket>
java.lang.Exception
public Message<byte[]> toMessage(java.net.DatagramPacket packet) throws java.lang.Exception
toMessage
in interface InboundMessageMapper<java.net.DatagramPacket>
java.lang.Exception