|
Hi everyone,
I have a question about ftp, which I haven't seen
in the news archive.
I use a ftp server which has one bad habit : just 1
logging / user.
So I can just log once in this ftp
server.
When I'm using ftp in ant, it works fine the first
time.
But the second time : I get a message : "Could not
login to FTP Server "
using a more usual ftp client : i find the reason :
"User already logged on"
and I have to wait for the server to timeout the
session.
So it seems that ant doesn't close the ftp
session properly.
I've been browsing ant source: and I see in the
corresponding task ( org.apache.tools.ant.taskdefs.optional.net.FTP with CVS tag
ANT 13)
------------------------------------------------------------------------------------------------------------------------
public void execute() throws
BuildException
{ [....]
try
{
[do the
job]
}
catch(IOException ex)
{ throw new BuildException("error during FTP transfer: " + ex); } finally { /* <<<<< this part is commented
if (ftp != null && ftp.isConnected())
{ try { // this hangs - I don't know why. ftp.disconnect(); } catch(IOException ex) { // ignore it } } */ } } So it seem really that the ftp session is not
closed.
Does anyone know how to close it
anyway?
What is strange is that sometime the ftp session
seem to be closed? maybe the java-runtime had time to run a garbage collection
which closed the session....
Anyway, thanks for your help.
Pedro
|
