title: Commons FTPClient - storeFile() hangs, if FTP server becomes unavailable
body: <p>I use Apache's FTPClient to upload files to a FTP server.</p>
  
  <p>However, even the FTP servers becomes unavailable while we upload a file, storeFile() hangs. storeFile() does not cancel the upload.</p>
  
  <p>tcpdump trace:</p>
  
  <p>22:04:29.584767 IP 10.84.78.2 > 192.168.114.2: ICMP 10.84.78.2 tcp port 53751 unreachable, length 142</p>
  
  <p>Is there a way to set timeout? I already tried to use setSoTimeout() after connect() and setDataTimeout() before storeFile(). But this attributes seems to be irrelevant for this issue.</p>
  
  <p>Thread dump, taken after FTP server is unavailable:</p>
  
  <pre><code>    "Thread-1" prio=10 tid=0x00007f1a700f1800 nid=0x479b runnable [0x00007f1a76fea000]
         java.lang.Thread.State: RUNNABLE
  at java.net.SocketOutputStream.socketWrite0(Native Method)
  at java.net.SocketOutputStream.socketWrite(Unknown Source)
  at java.net.SocketOutputStream.write(Unknown Source)
  at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
  at java.io.BufferedOutputStream.write(Unknown Source)
  - locked &lt;0x00000000bb026df8&gt; (a java.io.BufferedOutputStream)
  at org.apache.commons.net.io.ToNetASCIIOutputStream.write(ToNetASCIIOutputStream.java:75)
  - locked &lt;0x00000000bb028e20&gt; (a org.apache.commons.net.io.ToNetASCIIOutputStream)
  at org.apache.commons.net.io.Util.copyStream(Util.java:111)
  at org.apache.commons.net.ftp.FTPClient._storeFile(FTPClient.java:653)
  at org.apache.commons.net.ftp.FTPClient.__storeFile(FTPClient.java:624)
  at org.apache.commons.net.ftp.FTPClient.storeFile(FTPClient.java:1976)
  at ... (FTPClient.java:103)
  at ... (Sender.java:67)
  </code></pre>
  
  <p>netstat -anpo output:</p>
  
  <p>netstat -anpo | grep 192</p>
  
  <pre><code>tcp6       0      0 10.84.78.2:9011         192.168.114.2:21        VERBUNDEN   19310/java       aus (0.00/0/0)
  tcp6       0 201480 10.84.78.2:33088        192.168.114.2:20        VERBUNDEN   19310/java       ein (10,26/2/0)
  </code></pre>