IceCold
IceCold

Reputation: 21194

How to increase Indy idFTP buffer?

The OnFtpWork event fires really often for idFTP. IF it writes that often to disk then it will be a waste of time. Is there a way to increase the buffer so it will write to disk not often than once per second?

Upvotes: 0

Views: 549

Answers (1)

Remy Lebeau
Remy Lebeau

Reputation: 597036

You can set the TIdFTP.IOHandler.SendBufferSize and TIdFTP.IOHandler.RecvBufferSize properties before performing a transfer. They will be copied to the IOHandler used for the transfer connection.

Or you can use the TIdFTP.OnDataChannelCreate event to set the ADataChannel.IOHandler.SendBufferSize and ADataChannel.IOHandler.RecvBufferSize properties.

Or you can implement a TFileStream derived class that uses buffered file I/O internally, then you don't have to mess with TIdFTP's buffers.

Upvotes: 1

Related Questions