views:

30

answers:

1

I have an application where I need to count accurately number of bytes uploaded and downloaded (on both window and linux palrforms) on GPRS connection (a ppp connection). The application is in java. However I doubt if I can do it in pure java. Mix of commandline and java is also OK. How do I do it?

A: 

In Linux you can just open the pseudo-file /proc/net/dev for reading, and look for the line starting with the name of the PPP device that you're interested in (eg. ppp0, ppp1, ...).

caf