public interface Driver
| Modifier and Type | Method and Description |
|---|---|
Connector |
connector()
Get the next active connector in the driver.
|
java.lang.Iterable<Connector> |
connectors()
Return an iterator over all connectors.
|
<C> Connector<C> |
createConnector(java.nio.channels.SelectableChannel fd,
C context)
Create a connector using the existing file descriptor.
|
<C> Connector<C> |
createConnector(java.lang.String host,
int port,
C context)
Construct a connector to the given remote address.
|
<C> Listener<C> |
createListener(java.nio.channels.ServerSocketChannel c,
C context)
Create a listener using the existing channel.
|
<C> Listener<C> |
createListener(java.lang.String host,
int port,
C context)
Construct a listener for the given address.
|
void |
destroy()
Destruct the driver and all associated listeners, connectors and other resources.
|
void |
doWait(long timeout)
Wait for an active connector or listener
|
Listener |
listener()
Get the next listener with pending data in the driver.
|
java.lang.Iterable<Listener> |
listeners()
Return an iterator over all listeners.
|
void |
wakeup()
Force wait() to return
|
void wakeup()
void doWait(long timeout)
timeout - maximum time in milliseconds to wait.
0 means infinite waitListener listener()
Connector connector()
void destroy()
<C> Listener<C> createListener(java.lang.String host, int port, C context)
host - local host address to listen onport - local port to listen oncontext - application-supplied, can be accessed via
getContext() method on a listener.<C> Listener<C> createListener(java.nio.channels.ServerSocketChannel c, C context)
c - existing SocketChannel for listener to listen oncontext - application-supplied, can be accessed via
getContext() method on a listener.<C> Connector<C> createConnector(java.lang.String host, int port, C context)
host - remote host to connect to.port - remote port to connect to.context - application-supplied, can be accessed via
getContext() method on a listener.<C> Connector<C> createConnector(java.nio.channels.SelectableChannel fd, C context)
fd - existing SocketChannel for listener to listen oncontext - application-supplied, can be accessed via
getContext() method on a listener.java.lang.Iterable<Listener> listeners()
java.lang.Iterable<Connector> connectors()
Copyright © 2013 FuseSource, Corp.. All Rights Reserved.