Board index » delphi » Indy10: Throttling HTTP

Indy10: Throttling HTTP


2007-01-30 10:54:09 PM
delphi211
Hi,
Could someone post a working piece of code which throttles IdHTTP1
bandwidth ?
I CANNOT find any example with TIdInterceptThrottler (Indy 10). I'm
trying this, but when I call IdHttp1.Post later, excepction is thrown.
IdThrottler := TIdInterceptThrottler.Create(IdHttp1);
IdThrottler.BitsPerSec := 64000;
IdHTTP1.IOHandler := TIdIOHandler.Create(IdHTTP1);
IdHTTP1.IOHandler.Intercept := TIdThrottler;
Thanks,
 
 

Re:Indy10: Throttling HTTP

On Jan 30, 4:54 pm, "Ladislav Prokopny" <XXXX@XXXXX.COM>writes:
Quote
Hi,

Could someone post a working piece of code which throttles IdHTTP1
bandwidth ?
I CANNOT find any example with TIdInterceptThrottler (Indy10). I'm
trying this, but when I call IdHttp1.Post later, excepction is thrown.

IdThrottler := TIdInterceptThrottler.Create(IdHttp1);
IdThrottler.BitsPerSec := 64000;
IdHTTP1.IOHandler :=TIdIOHandler.Create(IdHTTP1);
IdHTTP1.IOHandler.Intercept := TIdThrottler;

Thanks,
I use it this way and it works:
IdThrottler := TIdInterceptThrottler.Create;
try
IdThrottler .BitsPerSec := 64000;
IdHTTP1.Intercept:=IdThrottler;
IdHTTP1.Get........
Monir