When scripting, I would like to specify that the session attempt to reconnect if it cannot connect initially. It would solve a problem I had recently. My script was setup to transfer a file. However, when attempting to connect, the script logged this:
Using username "<username>".
Waiting for data timed out, asking user what to do.
**Host is not communicating for 15 seconds.
Wait for another 15 seconds?** ()
Attempt to close connection due to fatal exception:
**Terminated by user.**
Sending special code: 12
I think the FTP site was not accepting connections at that time. Another script connected fine fifteen minutes later and transferred a file. Would I use
or something else to keep attempting to connect? Can I set the number of retries?