I have a lot of problems with the FTP timeout because we run a lot of ant tasks using the ftp and, if one stops by a infinite timeout, all the next task will never run. FtpClient supports the timeout, IMO only adding a timeout property to FTP task is ok because in the code is very easy fix this problem.
I am working with Ant FTP to transfer (GET) files from a website. To minimize traffic, the depends="yes" and retriesAllowed="5" is set. Still, the ant ftp task hangs on some files and the task does not continue. The script hangs (for hours, days). Assuming that this problem is related to timeouts, I also would love to see this feature implemented. There are reported implementations (as a "hack"): http://evgeny-goldin.com/blog/ant-ftp-task-progress-indicator-timeout/
Created attachment 36473 [details] patch introducing a reading timeout for FTP the attachment is in text format Short Description Introduce a read timeout, then receiving files which look infinite will not hang anymore. Sending is not concerned, as timeout will already occur if necessary. Tests It should be tested seriously, as FTP is not the most simple thing, and because we rely on external library (commons-net). My tests are OK for now, but maybe do you have servers to test against. What the patch does : . Introduce the dataTimeout as suggested by a comment, which will make impossible any infinite reading (described as 'FTP hangs' by many) . Call the abort command when the timeout is detected, then the server will be notified it should stop sending the current file. This abort is not sent in any urgent mode as described by RFC 959, as the commons-net doesn't support this feature yet. Although the effects are unsure since all servers are not implemented the same way, this feature is here to be compliant with the RFC.
Patch as provided manually verified and applied. I also updated the docs