You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Bogdan Drozdowski (Commented) (JIRA)" <ji...@apache.org> on 2011/10/01 16:09:33 UTC

[jira] [Commented] (NET-424) FTPSClient.isConnected() does not return false after server shutdown

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

Bogdan Drozdowski commented on NET-424:
---------------------------------------

This has been discussed in one of the issues in Commons-Net (I can't find it now). The problem is that the state of the Socket doesn't change when the connection is closed. It stays open even though many things could already have happened. The only way you can check if the connection is still open is to use it. You can send commands, send NOOPs or anything else and if get an exception, you know that the connection is down. You can enable keepalives, if you want, but FTPClient or FTPSClient won't do anything for you, because it could break something.
                
> FTPSClient.isConnected() does not return false after server shutdown
> --------------------------------------------------------------------
>
>                 Key: NET-424
>                 URL: https://issues.apache.org/jira/browse/NET-424
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.0.1
>         Environment: Apache Lib:
>     commons-net-3.0.1.jar
>     Specification-Title: Commons Net
>     Specification-Vendor: The Apache Software Foundation
>     Specification-Version: 3.0.1
>     Bundle-Version: 3.0.1
>     Bundle-Name: Commons Net
> Java Version:
>     java version "1.6.0_24"
>     Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
>     Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
> Platform: 
>     Windows XP Professional x64 Edition Version 2003 Service Pack 2
>            Reporter: Sean MacLellan
>
> 1. Using the FTPSClient
> 2. connect to a remote server
> 3. begin sending files
> 4. manually shut down the server
> 5. Code catches error for the file that is being sent.
> 6. Code tests to see if the connection is still good (using FTPSClient.isConnected()), this returns true.
> 7. Try to send next file, all kinds of failures.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira