On 06/11/2013 17:29, Angus Robertson - Magenta Systems Ltd wrote:
15:36:17:405 Request MlsdAsync Done.
15:36:17:405 StatusCode = 0
15:36:17:405 LastResponse was : ''
15:36:17:405 Error = 426 ()
15:36:17:701 Session Connected, error = 0
15:36:17:701 Request MlsdAsync Done.
15:36:17:701 StatusCode = 220
15:36:17:701 LastResponse was : '220 ProFTPD 1.3.3a Server (My FTP
server) [::ffff:]'

You are sending commands out of sequence, the session connected event appears
after you've already sent two commands, you then start to download before
you've even logged into the server. You also ignore the 426 error and the
other out of sequence responses.

Looks like you are using async methods and not waiting for them to complete
before sending more commands.
I don't think so (though I will double check), as this is happening about 30 seconds in to the process, I've already iterated through all the directories and put together a list of files I need to download and downloaded quite a few of them. The process all started here, where you can see the Session Connected, error = 0, the Session Connected message at 15:36:17:701 occured after the error 426 which I am (wrongly) ignoring

15:35:52:762 Logging started  06/11/2013 15:35:52
15:35:52:762 Created FTP Client
15:35:52:762 in DoGetUpdateFiles
15:35:52:762 Passive Mode = TRUE
15:35:52:762 Attempting to connect to FTP
15:35:52:762 connect to ftp
15:35:53:075 Session Connected, error = 0
15:35:53:387 Request ConnectAsync Done.
15:35:53:387 StatusCode = 230
15:35:53:387 LastResponse was : '230 Anonymous access granted, restrictions apply'
15:35:53:387 No error
15:35:53:387 Attempting directory change to: /pub/HireTRACK NX/autoupdates/

My question is whether FTPClient component has this reconnection
and retry option already built in (and I just need to activate it
by setting a property) or whether I need to code it up myself ?
Retrying won't help if you are not waiting for command to complete.
The basic FTP component does not automate anything except the login sequence,
and does not handle any errors with retries.

Instead you should use TMagFtp from:


which automates everything and does file and session retries, if requested.

I tested earlier with your DUNmanager as I read that it uses the TMagFtp and that had a similar problem (though it could be because I hadn't set something correctly) I tried the View Remote Files option, with all logging turned on. After a couple of hundred files it gave up too.

< 227 Entering Passive Mode (205,196,214,163,179,155).
> MLSD /pub/HireTRACK NX/autoupdates/navigator_nxserver/
FTP Session Closed
Directory Listing Abandoned, Not Connected
Directory Listing Abandoned, Failed Response
Task Result: Failed
Request Failed: No Directory Listing

To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to