public class UdpTransport extends TransportThreadSupport implements Transport, Service, Runnable
Transport
interface using raw UDPModifier | Constructor and Description |
---|---|
protected |
UdpTransport(OpenWireFormat wireFormat) |
|
UdpTransport(OpenWireFormat wireFormat,
int port)
Used by the server transport
|
|
UdpTransport(OpenWireFormat wireFormat,
SocketAddress socketAddress) |
|
UdpTransport(OpenWireFormat wireFormat,
URI remoteLocation) |
Modifier and Type | Method and Description |
---|---|
protected void |
bind(DatagramSocket socket,
SocketAddress localAddress) |
protected DatagramChannel |
connect(DatagramChannel channel,
SocketAddress targetAddress2) |
protected InetSocketAddress |
createAddress(URI remoteLocation)
Creates an address from the given URI
|
protected CommandChannel |
createCommandChannel() |
protected CommandChannel |
createCommandDatagramChannel() |
protected DatagramHeaderMarshaller |
createDatagramHeaderMarshaller() |
protected SocketAddress |
createLocalAddress() |
Replayer |
createReplayer()
Creates a replayer for working with the reliable transport
|
protected void |
doStart() |
protected void |
doStop(ServiceStopper stopper) |
ByteBufferPool |
getBufferPool() |
protected DatagramChannel |
getChannel() |
CommandChannel |
getCommandChannel() |
int |
getDatagramSize() |
InetSocketAddress |
getLocalSocketAddress() |
int |
getMinmumWireFormatVersion() |
int |
getPort() |
protected String |
getProtocolName() |
protected String |
getProtocolUriScheme() |
int |
getReceiveCounter()
Returns a counter which gets incremented as data is read from the transport.
|
String |
getRemoteAddress() |
ReplayBuffer |
getReplayBuffer() |
ReplayStrategy |
getReplayStrategy() |
IntSequenceGenerator |
getSequenceGenerator() |
protected SocketAddress |
getTargetAddress() |
OpenWireFormat |
getWireFormat() |
boolean |
isReplayEnabled() |
boolean |
isTrace() |
boolean |
isUseLocalHost() |
void |
oneway(Object command)
A one way asynchronous send
|
void |
oneway(Object command,
SocketAddress address)
A one way asynchronous send to a given address
|
protected String |
resolveHostName(String host) |
void |
run()
reads packets from a Socket
|
void |
setBufferPool(ByteBufferPool bufferPool) |
protected void |
setChannel(DatagramChannel channel) |
void |
setCommandChannel(CommandDatagramChannel commandChannel)
Sets the implementation of the command channel to use.
|
void |
setDatagramSize(int datagramSize) |
void |
setMinmumWireFormatVersion(int minmumWireFormatVersion) |
void |
setPort(int port)
Sets the port to connect on
|
void |
setReplayBuffer(ReplayBuffer replayBuffer) |
void |
setReplayEnabled(boolean replayEnabled)
Sets whether or not replay should be enabled when using the reliable
transport.
|
void |
setReplayStrategy(ReplayStrategy replayStrategy)
Sets the strategy used to replay missed datagrams
|
void |
setSequenceGenerator(IntSequenceGenerator sequenceGenerator) |
void |
setTargetEndpoint(Endpoint newTarget)
We have received the WireFormatInfo from the server on the actual channel
we should use for all future communication with the server, so lets set
the target to be the actual channel that the server has chosen for us to
talk on.
|
void |
setTrace(boolean trace) |
void |
setUseLocalHost(boolean useLocalHost)
Sets whether 'localhost' or the actual local host name should be used to
make local connections.
|
String |
toString() |
getStackSize, isDaemon, setDaemon, setStackSize
asyncRequest, checkStarted, doConsume, getTransportListener, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, narrow, onException, reconnect, request, request, setTransportListener, updateURIs
addServiceListener, dispose, isStarted, isStopped, isStopping, postStop, preStart, removeServiceListener, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
asyncRequest, getTransportListener, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, narrow, reconnect, request, request, setTransportListener, updateURIs
protected UdpTransport(OpenWireFormat wireFormat) throws IOException
IOException
public UdpTransport(OpenWireFormat wireFormat, URI remoteLocation) throws UnknownHostException, IOException
UnknownHostException
IOException
public UdpTransport(OpenWireFormat wireFormat, SocketAddress socketAddress) throws IOException
IOException
public UdpTransport(OpenWireFormat wireFormat, int port) throws UnknownHostException, IOException
UnknownHostException
IOException
public Replayer createReplayer() throws IOException
IOException
public void oneway(Object command) throws IOException
oneway
in interface Transport
IOException
public void oneway(Object command, SocketAddress address) throws IOException
IOException
public void setTargetEndpoint(Endpoint newTarget)
public boolean isTrace()
public void setTrace(boolean trace)
public int getDatagramSize()
public void setDatagramSize(int datagramSize)
public boolean isUseLocalHost()
public void setUseLocalHost(boolean useLocalHost)
public CommandChannel getCommandChannel() throws IOException
IOException
public void setCommandChannel(CommandDatagramChannel commandChannel)
public ReplayStrategy getReplayStrategy()
public void setReplayStrategy(ReplayStrategy replayStrategy)
public int getPort()
public void setPort(int port)
public int getMinmumWireFormatVersion()
public void setMinmumWireFormatVersion(int minmumWireFormatVersion)
public OpenWireFormat getWireFormat()
public IntSequenceGenerator getSequenceGenerator()
public void setSequenceGenerator(IntSequenceGenerator sequenceGenerator)
public boolean isReplayEnabled()
public void setReplayEnabled(boolean replayEnabled)
public ByteBufferPool getBufferPool()
public void setBufferPool(ByteBufferPool bufferPool)
public ReplayBuffer getReplayBuffer()
public void setReplayBuffer(ReplayBuffer replayBuffer) throws IOException
IOException
protected InetSocketAddress createAddress(URI remoteLocation) throws UnknownHostException, IOException
UnknownHostException
IOException
protected String resolveHostName(String host) throws UnknownHostException
UnknownHostException
protected void doStart() throws Exception
doStart
in class TransportThreadSupport
Exception
protected CommandChannel createCommandChannel() throws IOException
IOException
protected CommandChannel createCommandDatagramChannel()
protected void bind(DatagramSocket socket, SocketAddress localAddress) throws IOException
IOException
protected DatagramChannel connect(DatagramChannel channel, SocketAddress targetAddress2) throws IOException
IOException
protected SocketAddress createLocalAddress()
protected void doStop(ServiceStopper stopper) throws Exception
doStop
in class ServiceSupport
Exception
protected DatagramHeaderMarshaller createDatagramHeaderMarshaller()
protected String getProtocolName()
protected String getProtocolUriScheme()
protected SocketAddress getTargetAddress()
protected DatagramChannel getChannel()
protected void setChannel(DatagramChannel channel)
public InetSocketAddress getLocalSocketAddress()
public String getRemoteAddress()
getRemoteAddress
in interface Transport
public int getReceiveCounter()
Transport
getReceiveCounter
in interface Transport
Copyright © 2005–2016 FuseSource, Corp.. All rights reserved.