Regarding the type setting, you could derive your own component which keeps
a flag of the last type sent (binary or ascii) and before doing any store or
retrieve you could check if the binary property matched your flag. If not,
send the TYPE command and update your flag. This will avoid repeatedly
sending the command, but will mean you don't have to worry about the wrong
type being set, as long as the binary property is set as you want before an
operation.
Dan
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Anton Sviridov
Sent: 25 August 2008 12:55
To: twsocket@elists.org
Subject: [twsocket] FTPCli: Lose Socks settings in DataSocket on Close
Yes they do, since they only want to send it once when downloading
1,000
files or directories, not 1,000 times.
I suppose it''s better to waste 0.5 sec and 10 bytes of traffic on
setting type each time before download than constantly keep in mind,
what type is set now and whether we have to change it or not. Of
course, it''s just a my opinion.
Another issue I noticed is a strange behavior with LocalStream. It
supposed to be an external object, created outside FTPCli. So who has
given the component a right to Destroy it in DestroyLocalStream?
I''ll describe step by step.
1) Create SomeStream in the main program
2) Create FTPCli, all stuff
3) Assign FTPCli.LocalStream to SomeStream
4) Perform dir listing, parsing received info and so on
-- until that FStreamFlag prevents LocalStream from destroying --
5) Start downloading files, (!!!) Set LocalFileName. FStreamFlag
changes to False, but LocalStream is still assigned!
6) GetAsync destroys LocalStream, and, hence, our SomeStream.
7) So we have SomeStream which points to nothing, and we are one step
away from Access violation
Maybe I misunderstood the logic of the process, then please tell me
which way would be right.
But as I see, this is a kind of logical bug. Looks like the best
solution would be setting LocalStream to nil in SetLocalFileName
--
Best Regards, Anton
--
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
--
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