title: Setting connect timeout for FtpClient
body: <p>When using <code>ftpClient.connect</code> with an existing host who has no ftp service active, timeout occurs only after 5 minutes, which is much too long.</p>
  <p>I tried setting diverse timeouts (setDefaultTimeout, setDataTimeout) which did not change anything.</p>
  <p><code>FtpClient</code> inherits from <code>SocketClient</code> which has a setConnectTimeout method, but when I use this I get a <code>java.lang.NoSuchMethodError: org/apache/commons/net/ftp/FTPClient.setConnectTimeout</code> when running it. This seems to be because of some J2SW 1.2 compatibility, as described in Commons-net FAQ:</p>
  <p>Q: How can I set a connection timeout? <a href="http://wiki.apache.org/commons/Net/FrequentlyAskedQuestions" rel="nofollow noreferrer">http://wiki.apache.org/commons/Net/FrequentlyAskedQuestions</a></p>
  <p>They suggest to implement an own <code>SocketFactory</code> creating objects from an extended Socket class using a specific timeout. However, when trying to use <code>ftpClient.setSocketFactory</code> I also get a <code>java.lang.NoSuchMethodError</code>.</p>
  <p>Any help how I can reduce the connect timeout?</p>