getConnector().connect(address).addListener(new IoFutureListener<ConnectFuture>() {
public void operationComplete(ConnectFuture cf) {
if (cf.getException() != null) {
future.setException(cf.getException());
} else if (cf.isCanceled()) {
future.cancel();
} else {
future.setSession(getSession(cf.getSession()));
}
}
});