Re: Problems with TIdFtp

Giganews Newsgroups
Subject: Re: Problems with TIdFtp
Posted by:  Remy Lebeau (TeamB) (
Date: Fri, 15 Apr 2005

"Staffan Bergbom" <Staffan.Bergb…> wrote in message

>    if frmDataMessengerFtpMain.ActivateLogging.Checked then

That is not thread safe.  Use Synchronize().

>    WaitMessage;
>    getmessage(TmpMsg,0,0,0);

You are not checking for errors.

>      if not FSQLConnection.Connected then
>        if not ConnectToDatabase then Continue;

Is your DB code thread-safe?

>          FIdFTP.Abort;

Don't call Abort() unless you are in the middle of a transfer.  Which is
impossible in this code since the thread is blocked during a transfer to
begin with.

>          FIdFTP.Disconnect;
>          if FIdFTP.Connected then

That should never happen.

> --------At this point the polling timer don't seem to get enabled any more

That suggests that your own code is faulty, for not posting the message to
the main thread to begin with.  You are probably not protecting your thread
for errors adaquately enough.



In response to

Problems with TIdFtp posted by Staffan Bergbom on Fri, 15 Apr 2005