public class UdpTransport extends TransportThreadSupport implements Transport, Service, 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,
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() |
X509Certificate[] |
getPeerCertificates() |
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()
Retrieves the WireFormat instance associated with this Transport instance.
|
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 |
setPeerCertificates(X509Certificate[] certificates)
Sets the certificates provided by the connected peer.
|
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, setStackSizeasyncRequest, checkStarted, doConsume, getTransportListener, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, narrow, onException, reconnect, request, request, setTransportListener, updateURIsaddServiceListener, dispose, isStarted, isStopped, isStopping, postStop, preStart, 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 IOException
IOExceptionpublic UdpTransport(OpenWireFormat wireFormat, URI remoteLocation) throws UnknownHostException, IOException
UnknownHostExceptionIOExceptionpublic UdpTransport(OpenWireFormat wireFormat, SocketAddress socketAddress) throws IOException
IOExceptionpublic UdpTransport(OpenWireFormat wireFormat, int port) throws UnknownHostException, IOException
UnknownHostExceptionIOExceptionpublic Replayer createReplayer() throws IOException
IOExceptionpublic void oneway(Object command) throws IOException
oneway in interface TransportIOExceptionpublic void oneway(Object command, SocketAddress address) throws IOException
IOExceptionpublic 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
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()
TransportgetWireFormat in interface Transportpublic 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
IOExceptionprotected InetSocketAddress createAddress(URI remoteLocation) throws UnknownHostException, IOException
UnknownHostExceptionIOExceptionprotected String resolveHostName(String host) throws UnknownHostException
UnknownHostExceptionprotected void doStart() throws Exception
doStart in class TransportThreadSupportExceptionprotected CommandChannel createCommandChannel() throws IOException
IOExceptionprotected CommandChannel createCommandDatagramChannel()
protected void bind(DatagramSocket socket, SocketAddress localAddress) throws IOException
IOExceptionprotected DatagramChannel connect(DatagramChannel channel, SocketAddress targetAddress2) throws IOException
IOExceptionprotected SocketAddress createLocalAddress()
protected void doStop(ServiceStopper stopper) throws Exception
doStop in class ServiceSupportExceptionprotected 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 Transportpublic int getReceiveCounter()
TransportgetReceiveCounter in interface Transportpublic X509Certificate[] getPeerCertificates()
getPeerCertificates in interface Transportpublic void setPeerCertificates(X509Certificate[] certificates)
TransportsetPeerCertificates in interface Transportcertificates - the Certificates provided by the peer.Copyright © 2005–2020 The Apache Software Foundation. All rights reserved.