I found that when setting the ConnectTimeoout property for the TIdHTTP component, it makes requests (GET and POST) about 120 ms slower?
Why is this, and can I somehow avoid this?
Env: D2010 with Indy components sent, all updates are installed for D2010. OS is WinXP (32 bit) SP3 with most patches ...
My sync procedure:
Procedure DoGet; Var Freq,T1,T2 : Int64; Cli : TIdHTTP; S : String; begin QueryPerformanceFrequency(Freq); Try QueryPerformanceCounter(T1); Cli := TIdHTTP.Create( NIL ); Cli.ConnectTimeout := 1000; // without this we get < 15ms!! S := Cli.Get('http://127.0.0.1/empty_page.php'); Finally FreeAndNil(Cli); QueryPerformanceCounter(T2); End; Memo1.Lines.Add('Time = '+FormatFloat('0.000',(T2-T1)/Freq) ); End;
With the ConnectTimeout installed in the code, I get avg. times 130-140 ms, without it about 5-15 ms ...
K.Sandell
source share