|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.fusesource.hawtdispatch.transport.ServiceBase
org.fusesource.hawtdispatch.transport.UdpTransport
public class UdpTransport
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.fusesource.hawtdispatch.transport.ServiceBase |
|---|
ServiceBase.STARTING, ServiceBase.State, ServiceBase.STOPPING |
| Field Summary | |
|---|---|
static SocketAddress |
ANY_ADDRESS
|
protected DatagramChannel |
channel
|
protected ProtocolCodec |
codec
|
protected DispatchQueue |
dispatchQueue
|
protected CustomDispatchSource<Integer,Integer> |
drainOutboundSource
|
static int |
IPTOS_LOWCOST
|
static int |
IPTOS_LOWDELAY
|
static int |
IPTOS_RELIABILITY
|
static int |
IPTOS_THROUGHPUT
|
protected TransportListener |
listener
|
protected URI |
localLocation
|
protected URI |
remoteLocation
|
protected org.fusesource.hawtdispatch.transport.UdpTransport.SocketState |
socketState
|
protected boolean |
useLocalHost
|
protected CustomDispatchSource<Integer,Integer> |
yieldSource
|
| Fields inherited from class org.fusesource.hawtdispatch.transport.ServiceBase |
|---|
_serviceState, CREATED, STARTED, STOPPED |
| Constructor Summary | |
|---|---|
UdpTransport()
|
|
| Method Summary | |
|---|---|
void |
_start(Task onCompleted)
|
void |
_stop(Task onCompleted)
|
void |
connected(DatagramChannel channel)
|
void |
connecting(URI remoteLocation,
URI localLocation)
|
protected void |
drainInbound()
|
void |
flush()
Forces a flush of any output buffers. |
boolean |
full()
|
DatagramChannel |
getDatagramChannel()
|
DispatchQueue |
getDispatchQueue()
Returns the dispatch queue used by the transport |
SocketAddress |
getLocalAddress()
|
ProtocolCodec |
getProtocolCodec()
|
int |
getReceiveBufferSize()
|
SocketAddress |
getRemoteAddress()
|
int |
getSendBufferSize()
|
int |
getTrafficClass()
|
TransportListener |
getTransportListener()
Returns the current transport listener |
protected void |
initializeChannel()
|
protected void |
initializeCodec()
|
boolean |
isClosed()
|
boolean |
isConnected()
|
boolean |
isUseLocalHost()
|
boolean |
offer(Object command)
A one way asynchronous send of a command. |
protected void |
onConnected()
|
void |
onTransportFailure(IOException error)
|
ReadableByteChannel |
readChannel()
|
protected String |
resolveHostName(String host)
|
void |
resumeRead()
resume delivery of commands. |
protected void |
resumeWrite()
|
void |
setDispatchQueue(DispatchQueue queue)
Sets the dispatch queue used by the transport |
void |
setProtocolCodec(ProtocolCodec protocolCodec)
Sets the protocol codec for the transport |
void |
setReceiveBufferSize(int receiveBufferSize)
|
void |
setSendBufferSize(int sendBufferSize)
|
void |
setTrafficClass(int trafficClass)
|
void |
setTransportListener(TransportListener transportListener)
Registers an inbound command listener |
void |
setUseLocalHost(boolean useLocalHost)
Sets whether 'localhost' or the actual local host name should be used to make local connections. |
void |
suspendRead()
suspend delivery of commands. |
protected void |
suspendWrite()
|
protected boolean |
transportFlush()
|
WritableByteChannel |
writeChannel()
|
| Methods inherited from class org.fusesource.hawtdispatch.transport.ServiceBase |
|---|
getServiceState, start, start, stop, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.fusesource.hawtdispatch.transport.Transport |
|---|
start, start, stop, stop |
| Field Detail |
|---|
public static final SocketAddress ANY_ADDRESS
protected URI remoteLocation
protected URI localLocation
protected TransportListener listener
protected ProtocolCodec codec
protected DatagramChannel channel
protected org.fusesource.hawtdispatch.transport.UdpTransport.SocketState socketState
protected DispatchQueue dispatchQueue
protected CustomDispatchSource<Integer,Integer> drainOutboundSource
protected CustomDispatchSource<Integer,Integer> yieldSource
protected boolean useLocalHost
public static final int IPTOS_LOWCOST
public static final int IPTOS_RELIABILITY
public static final int IPTOS_THROUGHPUT
public static final int IPTOS_LOWDELAY
| Constructor Detail |
|---|
public UdpTransport()
| Method Detail |
|---|
public void connected(DatagramChannel channel)
throws IOException,
Exception
IOException
Exception
protected void initializeChannel()
throws Exception
Exception
protected void initializeCodec()
throws Exception
Exception
public void connecting(URI remoteLocation,
URI localLocation)
throws IOException,
Exception
IOException
Exceptionpublic DispatchQueue getDispatchQueue()
Transport
getDispatchQueue in interface TransportgetDispatchQueue in class ServiceBasepublic void setDispatchQueue(DispatchQueue queue)
Transport
setDispatchQueue in interface Transportpublic void _start(Task onCompleted)
_start in class ServiceBasepublic void _stop(Task onCompleted)
_stop in class ServiceBase
protected String resolveHostName(String host)
throws UnknownHostException
UnknownHostException
protected void onConnected()
throws IOException
IOExceptionpublic void onTransportFailure(IOException error)
public boolean full()
full in interface Transportpublic boolean offer(Object command)
Transport
offer in interface Transportpublic void flush()
Transport
flush in interface Transport
protected boolean transportFlush()
throws IOException
IOExceptionprotected void drainInbound()
public SocketAddress getLocalAddress()
getLocalAddress in interface Transportpublic SocketAddress getRemoteAddress()
getRemoteAddress in interface Transportpublic void suspendRead()
Transport
suspendRead in interface Transportpublic void resumeRead()
Transport
resumeRead in interface Transportprotected void suspendWrite()
protected void resumeWrite()
public TransportListener getTransportListener()
Transport
getTransportListener in interface Transportpublic void setTransportListener(TransportListener transportListener)
Transport
setTransportListener in interface Transportpublic ProtocolCodec getProtocolCodec()
getProtocolCodec in interface Transport
public void setProtocolCodec(ProtocolCodec protocolCodec)
throws Exception
Transport
setProtocolCodec in interface TransportExceptionpublic boolean isConnected()
isConnected in interface Transportpublic boolean isClosed()
isClosed in interface Transportpublic boolean isUseLocalHost()
public void setUseLocalHost(boolean useLocalHost)
public DatagramChannel getDatagramChannel()
public ReadableByteChannel readChannel()
public WritableByteChannel writeChannel()
public int getTrafficClass()
public void setTrafficClass(int trafficClass)
public int getReceiveBufferSize()
public void setReceiveBufferSize(int receiveBufferSize)
public int getSendBufferSize()
public void setSendBufferSize(int sendBufferSize)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||