public interface ConnectFuture extends IoFuture
IoFuture
for asynchronous connect requests.
IoConnector connector = ...; ConnectFuture future = connector.connect(...); future.join(); // Wait until the connection attempt is finished. IoSession session = future.getSession(); session.write(...);
限定符和类型 | 方法和说明 |
---|---|
IoSession |
getSession()
Returns
IoSession which is the result of connect operation. |
boolean |
isConnected()
Returns true if the connect operation is finished successfully.
|
void |
setException(java.lang.Throwable exception)
Sets the exception caught due to connection failure and notifies all
threads waiting for this future.
|
void |
setSession(IoSession session)
Sets the newly connected session and notifies all threads waiting for
this future.
|
addListener, getLock, isReady, join, join, removeListener
IoSession getSession() throws RuntimeIOException
IoSession
which is the result of connect operation.getSession
在接口中 IoFuture
RuntimeIOException
- if connection attempt failed by an exceptionboolean isConnected()
void setSession(IoSession session)
void setException(java.lang.Throwable exception)