Re: TidFTP.OnWork does not work on Indy 9.0.18

Giganews Newsgroups
Subject: Re: TidFTP.OnWork does not work on Indy 9.0.18
Posted by:  Remy Lebeau \(Indy Team\) (
Date: Thu, 1 Nov 2007

"Serkan Güneþ" <adm…> wrote in message

> my application to use Indy 9.0.18

The current version of Indy 9 is the 9.0.50 development snapshot.  You
should consider upgrading.

> I found that my TidFTP.OnWork events are no more triggered
> during a file upload, only the OnWorkBegin and onWorkEnd does.

The FTP protocol uses a secondary socket connection for data transfers.
TIdFTP uses TIdTCPConnection.WriteStream() on a separate TIdTCPClient or
TIdSimpleServer for uploads.  In earlier Indy 9 releases, WriteStream() had
write buffering enabled.  That would cause the OnWork event to be ignored
until the buffer is closed (and waste a lot of memory as well, causing
socket errors), but the buffer was not closed until after the OnWorkEnd
event had already been triggered.  That bug was fixed in a later Indy 9

Whether that is the actual cause of your problem, I do not know.  I looked
at the 9.0.18 source code from Indy's website.  WriteStream() does not have
write buffering enabled in that release.  Perhaps you downloaded a later
snapshot that has the bug but did not increment the version number yet? Only
way to know is to look at WriteStream() actual code in your copy.

In any case, you really should upgrade and see if the problem still happens.

> Perhaps the problem could be on TIdIOHandler where the Write
> method does not call for DoWork (only the TIdIOHandlerStack.WriteDirect
> does)

TIdIOHandlerStack is an Indy 10 class.  It does not exist in Indy 9.




In response to

TidFTP.OnWork does not work on Indy 9.0.18 posted by Serkan Güneþ on Thu, 1 Nov 2007