Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Jan : Indy: Throttling...
| Subject: | Indy: Throttling... |
| Posted by: | "Turboz" (turb..@turboz.moved.in) |
| Date: | Tue, 16 Jan 2007 19:57:19 |
Hi
I just been looking through the Indy 10 source (IdInterceptThrottler.pas)
and I noticed this:
procedure TIdInterceptThrottler.Receive(var ABuffer: TIdBytes);
begin
inherited Receive(ABuffer);
if BitsPerSec > 0 then begin
TIdAntiFreezeBase.Sleep((Length(ABuffer) * 8 * 1000) div BitsPerSec);
end;
end;
procedure TIdInterceptThrottler.Send(var ABuffer: TIdBytes);
begin
inherited Send(ABuffer);
if BitsPerSec > 0 then begin
TIdAntiFreezeBase.Sleep((Length(ABuffer) * 8 * 1000) div BitsPerSec);
end;
Is this the basic principle of throttling?
I'm still using Indy 8 in my main Delphi (Tried v10 in a vmware installed
Delphi and really can't get to grips with it) which doesn't include
throttling. Can I manually use code like this with a sleep feature?
Would be mighty useful...