commons-user mailing list archives

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

In message <>, 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 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.


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

View raw message