public class UdpTransport extends TransportThreadSupport implements Transport, Service, java.lang.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,
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, setStackSize
asyncRequest, checkStarted, doConsume, getTransportListener, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, narrow, onException, reconnect, request, request, setTransportListener, updateURIs
addServiceListener, dispose, isStarted, isStopped, isStopping, 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 java.io.IOException
java.io.IOException
public UdpTransport(OpenWireFormat wireFormat, java.net.URI remoteLocation) throws java.net.UnknownHostException, java.io.IOException
java.net.UnknownHostException
java.io.IOException
public UdpTransport(OpenWireFormat wireFormat, java.net.SocketAddress socketAddress) throws java.io.IOException
java.io.IOException
public UdpTransport(OpenWireFormat wireFormat, int port) throws java.net.UnknownHostException, java.io.IOException
java.net.UnknownHostException
java.io.IOException
public Replayer createReplayer() throws java.io.IOException
java.io.IOException
public 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.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public void run()
run
in interface java.lang.Runnable
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 java.io.IOException
java.io.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 java.io.IOException
java.io.IOException
protected java.net.InetSocketAddress createAddress(java.net.URI remoteLocation) throws java.net.UnknownHostException, java.io.IOException
java.net.UnknownHostException
java.io.IOException
protected java.lang.String resolveHostName(java.lang.String host) throws java.net.UnknownHostException
java.net.UnknownHostException
protected void doStart() throws java.lang.Exception
doStart
in class TransportThreadSupport
java.lang.Exception
protected CommandChannel createCommandChannel() throws java.io.IOException
java.io.IOException
protected CommandChannel createCommandDatagramChannel()
protected void bind(java.net.DatagramSocket socket, java.net.SocketAddress localAddress) throws java.io.IOException
java.io.IOException
protected java.nio.channels.DatagramChannel connect(java.nio.channels.DatagramChannel channel, java.net.SocketAddress targetAddress2) throws java.io.IOException
java.io.IOException
protected java.net.SocketAddress createLocalAddress()
protected void doStop(ServiceStopper stopper) throws java.lang.Exception
doStop
in class ServiceSupport
java.lang.Exception
protected 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 Transport
public int getReceiveCounter()
Transport
getReceiveCounter
in interface Transport
Copyright © 2005-2012. All Rights Reserved.