commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel F. Savarese" <...@savarese.org>
Subject Re: [net]FTPClient.connect() spend long time for "null" host
Date Thu, 17 Jun 2004 20:06:05 GMT

In message <20040615065124.69397.qmail@web11405.mail.yahoo.com>, aha writes:
>When I modified the code as following, it looks that
>resolved it.

Ideally, you would implement your own SocketFactory, perhaps by subclassing
DefaultSocketFactory, and use setSocketFactory.  Otherwise, you have to
modify the code every time there's a new Commons Net release.  Since
Commons Net 1.2 is using J2SE 1.2 as a compatibility baseline, the Socket
API additions that should have been in java.net from the start haven't
been incorporated.

>To all: Is it correct??? Any comments are welcome!

Yes, because the new Socket.connect method allows you to override
the connection timeout.  Previous to J2SE 1.4, you were stuck with
the OS TCP stack default value and forced to use native code or play
tricks with threads and timers to abort a connection attempt that
was taking too long.

daniel



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


Mime
View raw message