public class UdpTransport extends TransportThreadSupport implements Transport, Service, java.lang.Runnable
Transport interface using raw UDP| Modifier | Constructor and Description |
|---|---|
protected |
UdpTransport(OpenWireFormat wireFormat) |
|
UdpTransport(OpenWireFormat wireFormat,
int port)
Used by the server transport
|
|
UdpTransport(OpenWireFormat wireFormat,
java.net.SocketAddress socketAddress) |
|
UdpTransport(OpenWireFormat wireFormat,
java.net.URI remoteLocation) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
bind(java.net.DatagramSocket socket,
java.net.SocketAddress localAddress) |
protected java.nio.channels.DatagramChannel |
connect(java.nio.channels.DatagramChannel channel,
java.net.SocketAddress targetAddress2) |
protected java.net.InetSocketAddress |
createAddress(java.net.URI remoteLocation)
Creates an address from the given URI
|
protected CommandChannel |
createCommandChannel() |
protected CommandChannel |
createCommandDatagramChannel() |
protected DatagramHeaderMarshaller |
createDatagramHeaderMarshaller() |
protected java.net.SocketAddress |
createLocalAddress() |
Replayer |
createReplayer()
Creates a replayer for working with the reliable transport
|
protected void |
doStart() |
protected void |
doStop(ServiceStopper stopper) |
ByteBufferPool |
getBufferPool() |
protected java.nio.channels.DatagramChannel |
getChannel() |
CommandChannel |
getCommandChannel() |
int |
getDatagramSize() |
java.net.InetSocketAddress |
getLocalSocketAddress() |
int |
getMinmumWireFormatVersion() |
int |
getPort() |
protected java.lang.String |
getProtocolName() |
protected java.lang.String |
getProtocolUriScheme() |
int |
getReceiveCounter()
Returns a counter which gets incremented as data is read from the transport.
|
java.lang.String |
getRemoteAddress() |
ReplayBuffer |
getReplayBuffer() |
ReplayStrategy |
getReplayStrategy() |
IntSequenceGenerator |
getSequenceGenerator() |
protected java.net.SocketAddress |
getTargetAddress() |
OpenWireFormat |
getWireFormat() |
boolean |
isReplayEnabled() |
boolean |
isTrace() |
boolean |
isUseLocalHost() |
void |
oneway(java.lang.Object command)
A one way asynchronous send
|
void |
oneway(java.lang.Object command,
java.net.SocketAddress address)
A one way asynchronous send to a given address
|
protected java.lang.String |
resolveHostName(java.lang.String host) |
void |
run()
reads packets from a Socket
|
void |
setBufferPool(ByteBufferPool bufferPool) |
protected void |
setChannel(java.nio.channels.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.
|
java.lang.String |
toString() |
getStackSize, isDaemon, setDaemon, setStackSizeasyncRequest, checkStarted, doConsume, getTransportListener, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, narrow, onException, reconnect, request, request, setTransportListener, updateURIsaddServiceListener, dispose, isStarted, isStopped, isStopping, removeServiceListener, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitasyncRequest, getTransportListener, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, narrow, reconnect, request, request, setTransportListener, updateURIsprotected UdpTransport(OpenWireFormat wireFormat) throws java.io.IOException
java.io.IOExceptionpublic UdpTransport(OpenWireFormat wireFormat, java.net.URI remoteLocation) throws java.net.UnknownHostException, java.io.IOException
java.net.UnknownHostExceptionjava.io.IOExceptionpublic UdpTransport(OpenWireFormat wireFormat, java.net.SocketAddress socketAddress) throws java.io.IOException
java.io.IOExceptionpublic UdpTransport(OpenWireFormat wireFormat, int port) throws java.net.UnknownHostException, java.io.IOException
java.net.UnknownHostExceptionjava.io.IOExceptionpublic Replayer createReplayer() throws java.io.IOException
java.io.IOExceptionpublic void oneway(java.lang.Object command) throws java.io.IOException
public void oneway(java.lang.Object command, java.net.SocketAddress address) throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic void run()
run in interface java.lang.Runnablepublic 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 java.io.IOException
java.io.IOExceptionpublic 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 java.io.IOException
java.io.IOExceptionprotected java.net.InetSocketAddress createAddress(java.net.URI remoteLocation) throws java.net.UnknownHostException, java.io.IOException
java.net.UnknownHostExceptionjava.io.IOExceptionprotected java.lang.String resolveHostName(java.lang.String host) throws java.net.UnknownHostException
java.net.UnknownHostExceptionprotected void doStart() throws java.lang.Exception
doStart in class TransportThreadSupportjava.lang.Exceptionprotected CommandChannel createCommandChannel() throws java.io.IOException
java.io.IOExceptionprotected CommandChannel createCommandDatagramChannel()
protected void bind(java.net.DatagramSocket socket, java.net.SocketAddress localAddress) throws java.io.IOException
java.io.IOExceptionprotected java.nio.channels.DatagramChannel connect(java.nio.channels.DatagramChannel channel, java.net.SocketAddress targetAddress2) throws java.io.IOException
java.io.IOExceptionprotected java.net.SocketAddress createLocalAddress()
protected void doStop(ServiceStopper stopper) throws java.lang.Exception
doStop in class ServiceSupportjava.lang.Exceptionprotected DatagramHeaderMarshaller createDatagramHeaderMarshaller()
protected java.lang.String getProtocolName()
protected java.lang.String getProtocolUriScheme()
protected java.net.SocketAddress getTargetAddress()
protected java.nio.channels.DatagramChannel getChannel()
protected void setChannel(java.nio.channels.DatagramChannel channel)
public java.net.InetSocketAddress getLocalSocketAddress()
public java.lang.String getRemoteAddress()
getRemoteAddress in interface Transportpublic int getReceiveCounter()
TransportgetReceiveCounter in interface TransportCopyright © 2005-2012. All Rights Reserved.