You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Chris Handorf <ch...@onsemi.com> on 2004/01/28 22:39:58 UTC

[net] FTPClient completePendingCommand() method freezes every time

The FTPClient code I am using is quite simple and is shown below:

FTPClient ftp = new FTPClient();
ftp.connect(server);
ftp.login(user,pass);
ftp.changeWorkingDirectory(directory);

OutputStream out = ftp.storeFileStream(fileName);

// write some stuff into the OutputStream here

out.flush();
out.close();

// The line of code below returns
// "reply string: 150 ASCII data connection for order_631201.xml
(10.253.125.23,43647)"
System.out.print("reply string: "+ftp.getReplyString());

boolean result = ftp.completePendingCommand(); // this call returns
after 5 minutes with "false"


I converted my code to write the data to a file on disk first and then
call ftp.storeFile(fileName,in) instead of ftp.storeFileStream(fileName)
and everything works fine, but I would like to avoid having to write the
file to disk first.

I am behind a proxy but I get the same freeze when FTP'ing to an
internal machine.

Chris


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org