Event handling problems in spite of Blocking - WeOnlyDo Discussion board

Event handling problems in spite of Blocking (wodSFTP / wodSFTP.NET / wodSFTPdll)

by condev1972, Sunday, May 14, 2006, 17:34 (6582 days ago)

Good day,

I'm having a little trouble of finding out timing
problems with the events of the COM FtpDlx component
(v2.5.7.220; Blocking = True; Delphi 5 Ent. SP1 on
Win XP Pro SP2, connecting with FTP protocol to a
FileZilla server on a machine in a local network).

Process:
* user presses a button which does call the Connect1
method (renamed by Delphi for other reasons),
with property Blocking is set True .
* in the upcoming OnConnected event I then set the
RemotePath property and call ListDir .
* afterwards in the OnListItems event I fill a
listview component with the listing entries etc.

Problem:
Strangely the ListDir method is not always executed
from within the OnConnected event, at least not at
the very first time upon application startup.
Upon disconnect and reconnect (i.e. the 2nd time),
however, the directory listing does show up.

The same applies to GetFile method: directly after
the call I'm trying to load the downloaded file into
an editor component, which also does not work always.

Question:
I fear that I always have to use the OnDone event
to continue processing with whatever I need to do
with the FTP component, although Blocking is True ?

Meaning: I cannot use a downloaded file right after
the GetFile method, but have to wait for the Done
event. This would practically require shifting most of
the FTP processing code into the Done event itself and
manually keeping track of what the last command actually
was.
If, though, my above order of commands would be ok,
then the Blocking does not seem to work always in
my case.

Please be so kind to provide me some best practice
advice or hints of what I might have done wrong/what
is wrong with above assumptions.

Thank you very much in advance for your assistance.

Kind regards,
Tobias
[:smile:]


Complete thread: