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, write
public CommandDatagramSocket(UdpTransport transport, OpenWireFormat wireFormat, int datagramSize, SocketAddress targetAddress, DatagramHeaderMarshaller headerMarshaller, DatagramSocket channel)
public Command read() throws IOException
IOException
public void write(Command command, SocketAddress address) throws IOException
IOException
public int getDatagramSize()
getDatagramSize
in interface CommandChannel
getDatagramSize
in class CommandChannelSupport
public void setDatagramSize(int datagramSize)
CommandChannelSupport
setDatagramSize
in interface CommandChannel
setDatagramSize
in class CommandChannelSupport
protected void sendWriteBuffer(SocketAddress address, ByteArrayOutputStream writeBuffer, int commandId) throws IOException
IOException
protected void sendWriteBuffer(int commandId, SocketAddress address, byte[] data, boolean redelivery) throws IOException
IOException
public void sendBuffer(int commandId, Object buffer) throws IOException
Replayer
commandId
- the command IDbuffer
- the buffer to be sent - or null if the buffer no longer exists in the bufferIOException
protected DatagramPacket createDatagramPacket()
protected int remaining(ByteArrayOutputStream buffer)
protected ByteArrayOutputStream createByteArrayOutputStream()
public int getReceiveCounter()
Copyright © 2005–2016 FuseSource, Corp.. All rights reserved.