commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Whitlock, Jeremy x66075" <Jeremy_Whitl...@adp.com>
Subject [NET] FTP logout() timeout
Date Wed, 13 Apr 2005 22:43:34 GMT
	I am using the FTP portion of the commons net library and I have the
following code:

public void saveToFTP(XMLOutputter outputter, Document doc, URL saveURL) {
    FTPClient fc = new FTPClient();
    int reply;
        
    try {
        fc.connect(saveURL.getHost());
            
        reply = fc.getReplyCode();
            
        if(!FTPReply.isPositiveCompletion(reply)) {
            fc.disconnect();
	      System.err.println("FTP server refused connection.");
	      System.exit(1);
	  }
            
        fc.login("anonymous", "");
            
        outputter.output(doc, fc.storeFileStream(saveURL.getFile()));
            
        fc.logout();
        fc.disconnect();
    } catch (SocketException se) {
        System.err.println("Unable to open connection to " +
saveURL.getHost() + "!");
        se.printStackTrace();
    } catch (IOException ioe) {
        System.err.println("Unable to to " + saveURL.getFile() + "!");
        ioe.printStackTrace();
    }
}

When I run this the logout process takes so long that my FTP server
disconnects it.  My FTP server acknowledges that I sent the QUIT command but
then stays connected for some reason.  Is there anything I'm doing wrong to
keep the logout process from finishing quicker?  Thanks,

Jeremy Whitlock
ADP/SIS - Programmer Analyst
4725 Independence Street
Wheat Ridge, CO 80033
Phone:  (303) 590-6075
Fax:  (303) 590-6160

_
This message and any attachments are intended only for the use of the addressee and
may contain information that is privileged and confidential. If the reader of the 
message is not the intended recipient or an authorized representative of the
intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication in
error, please notify us immediately by e-mail and delete the message and any
attachments from your system.

Mime
  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message