LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   how to calculate the amount of data had been download (https://www.linuxquestions.org/questions/programming-9/how-to-calculate-the-amount-of-data-had-been-download-878500/)

z99 05-03-2011 03:43 AM

how to calculate the amount of data had been download
 
hi,
i'm trying to write a program with c socket programming,
what i am trying to reach is a program which will calculate a computer's downloaded data from the internet,just to know how much he/she download?
would anyone please just give the idea of how to do this!
thanks in advance

JohnGraham 05-03-2011 03:58 AM

libpcap is probably what you're after - it'll allow you (so long as you have root privileges) to see all the traffic that goes over the network on any given interface (or all interfaces - though that means you'll also get the loopback interface, which I'm not sure you'll want) and so see how much there is.


All times are GMT -5. The time now is 09:14 AM.