[ 
https://issues.apache.org/jira/browse/SSHD-1280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17569606#comment-17569606
 ] 

Lyor Goldstein commented on SSHD-1280:
--------------------------------------

I disagree with the need to re-phrase the documentation - I believe it defines 
+exactly+ the method's behavior. Obviously, if a channel is already open then 
cancelling an {{OpenFuture}} should have no effect on it. This is a slippery 
slope - why not also request to document the fact that if the session has been 
closed, or the channel has been closed 1 hour ago then {{OpenFuture#cancel}} 
has no effect.  No offenses, but one does not document that 2+2 = 4...

> Clarification of ConnectFuture#cancel(), AuthFuture#cancel(), 
> OpenFuture#cancel behaviours if connection,auhentication,channel open are 
> already done respectively
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SSHD-1280
>                 URL: https://issues.apache.org/jira/browse/SSHD-1280
>             Project: MINA SSHD
>          Issue Type: Documentation
>    Affects Versions: 2.8.0
>         Environment: Java SE 8, NetBeans IDE 8.2
>            Reporter: dgü
>            Priority: Major
>
> Hello!
>  
> {code:java}
>     /**
>      * Cancels the connection attempt and notifies all threads waiting for 
> this future.
>      */
>     void cancel();
> {code}
> Ref: 
> [https://github.com/apache/mina-sshd/blob/master/sshd-core/src/main/java/org/apache/sshd/client/future/ConnectFuture.java]
> {code:java}
>     /**
>      * Cancels the authentication attempt and notifies all threads waiting 
> for this future.
>      */
>     void cancel();
> {code}
> Ref: 
> [https://github.com/apache/mina-sshd/blob/master/sshd-core/src/main/java/org/apache/sshd/client/future/AuthFuture.java]
>  According to my tests;
>  * ConnectFuture#cancel() cancels client session connection attempt only if 
> connection is not established yet. If connection is established, it doesn't 
> cancel.
>  * AuthFuture#cancel() cancels client authentication attempt only if 
> authentication is not completed yet. If authentication is completed, it 
> doesn't cancel.
> are these behaviours are expected ? If so, it is possible to update the 
> documentation to rely on these behaviours ?
> Thanks in advance!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to