Re: Limit Transfer Speed of Files in TIdFTPServer

Giganews Newsgroups
Subject: Re: Limit Transfer Speed of Files in TIdFTPServer
Posted by:  Remy Lebeau (Indy Team) (no.spam@no.spam.com)
Date: Wed, 23 Aug 2006

"Dennis" <antispam@antispam.com> wrote in message
news:op.tep5zorndjpp…@compy686.westman.wave.ca...

> Hi, I was just wondering how I put a bandwidth limiter on
> the data channel and on the Command Stream?

Attach a Throttle component to each connection.  How you can actually do
that, however, depends on which version of Indy you are actually using.

> I tried many different ways

What EXACTLY have you tried?

> it's pretty hard to get access to that data channel connection
> from a context (impossible?) so that I can set the Intercept.

Getting access to the data connection is fairly easy.  Though you will have
to make one change to Indy and then recompile it first.

If you are using Indy 9, then add a public property to the
TIdDataChannelThread class to access the protected FDataChannel member.
During a transfer, you can then cast the TIdPeerThread pointer to a
TIdFTPServerThread, and then use its DataChannelThread property to reach the
newly added property.

If you are using Indy 10, then add the new property to the TIdDataChannel
class instead.  You can then cast the TIdContext pointer to
TIdFTPServerContext, and then use its DataChannel property to reach the
newly added property.

> Do I need to resort to an IOHandler that limits the speed?

No.

Gambit

Replies

In response to

Limit Transfer Speed of Files in TIdFTPServer posted by Dennis on Wed, 23 Aug 2006