You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Trustin Lee (JIRA)" <ji...@apache.org> on 2007/09/28 12:55:50 UTC
[jira] Resolved: (DIRMINA-269) Cancellation operation for
ConnectFuture
[ https://issues.apache.org/jira/browse/DIRMINA-269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Trustin Lee resolved DIRMINA-269.
---------------------------------
Resolution: Fixed
Assignee: Trustin Lee
Resolved. The following is an example code:
ConnectFuture f = connector.connect(new InetSocketAddress(
UNREACHABLE_HOST, 8080));
f.awaitUninterruptibly(500);
f.addListener(new IoFutureListener() {
public void operationComplete(IoFuture future) {
System.out.println(((ConnectFuture) future).isCanceled());
}
});
f.cancel();
Didn't add a test case though because it's difficult to write one.
> Cancellation operation for ConnectFuture
> ----------------------------------------
>
> Key: DIRMINA-269
> URL: https://issues.apache.org/jira/browse/DIRMINA-269
> Project: MINA
> Issue Type: New Feature
> Components: Core, Transport
> Reporter: Hooman Valibeigi
> Assignee: Trustin Lee
> Fix For: 2.0.0-M1
>
>
> Currently I'm using the following logic to connect to server
> ConnectFuture future = socket.connect(SocketAddress, IoHandler);
> future.join();
> try {
> session = future.getSession();
> } catch (Exception e) {
> // e.getCause() tells the error
> }
> it waits till the connection is established. but I want the user to be able to stop the connect process while it is not yet established. for example in cases that Connection_Timeout would occur, the user should wait till the time out is finished. is it possible to stop it whenever we desire?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.