Hi...
Thanks for your response. I logged a transfer (using lftp) and your supposition appears to be correct:
> put BIG_FILE
---> TYPE I
<--- 200 Switching to Binary mode.
---> PASV
<--- 227 Entering Passive Mode (208,38,15,26,173,215)
---- Connecting data socket to (208.38.15.26) port 44503
---> STOR BIG_FILE
<--- 150 Ok to send data.
**** control-socket: Connection timed out
---- Closing data socket
---- Closing control socket
---- Resolving host address...
---- 1 address found
---- Connecting to ftp.site.com (208.38.15.26) port 21
<--- 220 Welcome to Site. To upload, please cd to pub directory. You can make sub-directory before upload. To download, please cd to pub or its sub-directory as informed. List of files "ls" is not allowed
---> FEAT
<--- 211-Features:
<--- MDTM
<--- PASV
<--- REST STREAM
<--- SIZE
<--- UTF8
<--- 211 End
---> OPTS UTF8 ON
<--- 200 Always in UTF8 mode.
---> USER ftp
<--- 331 Please specify the password.
---> PASS XXXX
<--- 230 Login successful.
---> CWD /pub/nexen
<--- 250 Directory successfully changed.
---> TYPE I
<--- 200 Switching to Binary mode.
---> SIZE BIG_FILE
<--- 213 8036448820
---> PASV
copy: put rolled back to 8036514356, seeking get accordingly
<--- 227 Entering Passive Mode (208,38,15,26,130,16)
---- Connecting data socket to (208.38.15.26) port 33296
---> REST 8036448820
<--- 350 Restart position accepted (8036448820).
---> STOR BIG_FILE
<--- 150 Ok to send data.
---- Closing data socket
<--- 226 File receive OK.
15302132828 bytes transferred in 14849 seconds (1006.4K/s)
---- Closing idle connection
---> QUIT
<--- 221 Goodbye.
---- Closing control socket
The problem is I don't have control over the server configuration so I need some way to work around this issue on the client side. As you can see from the log above lftp is detecting when the control connection times out and reconnects and resumes the transfer. How can I detect when the control connection times out so that I can do a similar thing in my code?
Thanks,
Corey