commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knepp, Ethan" <>
Subject [NET] FTPClient - setDefaultTimeout() and setSoTimeout()
Date Wed, 28 Jul 2004 13:02:47 GMT
I am trying to set the connect timeout in the FTPClient.  Going by the
Javadocs for FTPClient and FTP, it seems that I want to call the
setDefaultTimeout(int timeout) just after instanciating a new FTPClient(),
but before calling connect(server), shown below.

FTPClient f= new FTPClient();

So I tried this out in the examples/ that came with the commons-net
src package.  I tried it for a bad non-existent hostname and for a bad
non-existent ip address.

The bad host name quickly returns in less than 5 seconds. 

FTPClient f= new FTPClient();

The bad ip address doesn't return in less than 5 seconds and doesn't return
in 5 seconds as one would expect.

FTPClient f= new FTPClient();

It depends which Operating System I am running the example on.  When running
it on Windows2K i get a consistent timeout on the connect() of about
22seconds, but on RedHat 8 timeout is 128 seconds.  

I am very confused because I see that alot of the other examples use the
setDefaultTimeout() prior to making their connection and they work.  Why is
setting the DefaultTimeout() prior to connect() not working for the


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message