Welcome,
I have to create caption with information about downloading speed in my application using indy http get compontent.
In my mind i found simple solution.
At onwork event i will get actual progress of downloading (size) and compare it with previous reading. (for example every 5 seconds). curent size minus previous (5 seconds eariel, stored in global var) divide by 5 seconds * 8 and i will get speed. If actual size is equal previous then sped is always 0.
So i want start codding, but i found problem in simple function called odwork.
procedure TForm1.HttpWork(ASender: TObject; AWorkMode: TWorkMode; AWorkCount: Int64); begin showmessage('hello im herre'); end;
Problem is, that function isnt called... I don't know why.
I'm downloading 100 MB file, and i cant see any showmessage...
Have any idea ? Regards
The OnWork... events are only fired if the connection's BeginWork() method has been called beforehand. Many of Indy's reading/writing methods do not call that automatically. However, TIdHTTP reads/writes request/response body data using TStream objects, and the connection's read/write TStream methods do call BeginWork() internally, so you will definately get OnWork... events fired during HTTP operations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With