public class CommandDatagramSocket extends CommandChannelSupport
datagramSize, headerMarshaller, name, replayAddress, sequenceGenerator, targetAddress, wireFormat| Constructor and Description |
|---|
CommandDatagramSocket(UdpTransport transport,
OpenWireFormat wireFormat,
int datagramSize,
SocketAddress targetAddress,
DatagramHeaderMarshaller headerMarshaller,
DatagramSocket channel) |
| Modifier and Type | Method and Description |
|---|---|
protected ByteArrayOutputStream |
createByteArrayOutputStream() |
protected DatagramPacket |
createDatagramPacket() |
int |
getDatagramSize() |
int |
getReceiveCounter() |
Command |
read() |
protected int |
remaining(ByteArrayOutputStream buffer) |
void |
sendBuffer(int commandId,
Object buffer)
Sends the given buffer back to the transport
if the buffer could be found - otherwise maybe send some kind
of exception
|
protected void |
sendWriteBuffer(int commandId,
SocketAddress address,
byte[] data,
boolean redelivery) |
protected void |
sendWriteBuffer(SocketAddress address,
ByteArrayOutputStream writeBuffer,
int commandId) |
void |
setDatagramSize(int datagramSize)
Sets the default size of a datagram on the network.
|
void |
start() |
void |
stop() |
void |
write(Command command,
SocketAddress address) |
getHeaderMarshaller, getReplayAddress, getReplayBuffer, getTargetAddress, setHeaderMarshaller, setReplayAddress, setReplayBuffer, setTargetAddress, toString, writepublic CommandDatagramSocket(UdpTransport transport, OpenWireFormat wireFormat, int datagramSize, SocketAddress targetAddress, DatagramHeaderMarshaller headerMarshaller, DatagramSocket channel)
public Command read() throws IOException
IOExceptionpublic void write(Command command, SocketAddress address) throws IOException
IOExceptionpublic int getDatagramSize()
getDatagramSize in interface CommandChannelgetDatagramSize in class CommandChannelSupportpublic void setDatagramSize(int datagramSize)
CommandChannelSupportsetDatagramSize in interface CommandChannelsetDatagramSize in class CommandChannelSupportprotected void sendWriteBuffer(SocketAddress address, ByteArrayOutputStream writeBuffer, int commandId) throws IOException
IOExceptionprotected void sendWriteBuffer(int commandId, SocketAddress address, byte[] data, boolean redelivery) throws IOException
IOExceptionpublic void sendBuffer(int commandId, Object buffer) throws IOException
ReplayercommandId - the command IDbuffer - the buffer to be sent - or null if the buffer no longer exists in the bufferIOExceptionprotected DatagramPacket createDatagramPacket()
protected int remaining(ByteArrayOutputStream buffer)
protected ByteArrayOutputStream createByteArrayOutputStream()
public int getReceiveCounter()
Copyright © 2005–2020 The Apache Software Foundation. All rights reserved.