W
W
WizAlx2013-03-05 09:47:38
Delphi
WizAlx, 2013-03-05 09:47:38

Using IpHlpAPI in Delphi?

Good morning time of day, Khabrchane.
Faced another problem. It is required to count the amount of received http traffic. On the advice of many forums, I decided to use the IpHlpAPI and IPHelper libraries.
After some digging, I wrote a small block of the program, which, unfortunately, does not work. I ask, once again, advice and help.

procedure TForm1.FormCreate(Sender: TObject);
var MibArr : IpHlpAPI.TMIBIfArray;
begin
  Get_IfTableMIB(MibArr);
  nulHTTP:=MibArr[1].dwInOctets;
end;

procedure TForm1.HTTPSendTimer(Sender: TObject);
var MibArr : IpHlpAPI.TMIBIfArray;
begin
  Get_IfTableMIB(MibArr);
  HTTPlbl.Caption:=IntToStr(MibArr[1].dwInOctets-nulHTTP); 
end;

Actually, both nulHTTP and MibArr[1].dwlnOctets are equal to zero.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Scioner, 2013-03-05
@WizAlx

It seems to me that you are counting traffic on the wrong interface. How did you figure out what exactly is MibArr[1] and not, say, MibArr[0], MibArr[2], etc.?
Well, if the task is precisely to calculate http traffic, then simple numbers from the interface are indispensable. Here it is necessary either to navigate by remote ports, or even analyze traffic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question