commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kurt Kurniawan" <>
Subject RE: [NET] FTP logout() timeout
Date Thu, 14 Apr 2005 04:45:34 GMT

I'm using FTP as well. I don't see anything wrong with your code.

I think the best thing to do is to compare with
the normal behaviour as you connect to the FTP from your command line.

Does it also timed out if you connect to FTP server from command line?
also try to do a completePendingCommand() after finishing the transfer and see how it goes


Kurt Kurniawan
Enterprise Application Integration
Senior Analyst/Programmer
Big W

-----Original Message-----
From: Whitlock, Jeremy x66075 []
Sent: Thursday, 14 April 2005 8:44 AM
Subject: [NET] FTP logout() timeout

	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 {
        reply = fc.getReplyCode();
        if(!FTPReply.isPositiveCompletion(reply)) {
	      System.err.println("FTP server refused connection.");
        fc.login("anonymous", "");
        outputter.output(doc, fc.storeFileStream(saveURL.getFile()));
    } catch (SocketException se) {
        System.err.println("Unable to open connection to " +
saveURL.getHost() + "!");
    } catch (IOException ioe) {
        System.err.println("Unable to to " + saveURL.getFile() + "!");

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.

CAUTION: This message may contain confidential information intended only for the use of the
addressee named above. If you are not the intended
recipient of this message, any use or disclosure of this message is prohibited. If you received
this message in error please notify email Administrators immediately.  You must obtain all
necessary intellectual property clearances before doing anything other than displaying this
message on your monitor. There is no intellectual property licence.  Any views expressed in
this message are those of the individual sender and may not necessarily reflect the views
of BIG W Discount Stores.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message