Question

Is there a way to get amount of bytes received/sent by a network interface using Qt on a Windows platform ? If it is cross-platform is even better.

I couldn't find anything useful in QtNetwork module.

Was it helpful?

Solution

The lowest OSI model layer which Qt can manage is the transport layer (maybe the layer 3 but I don't think). You can only get the number of received/sent bytes from/to a given port.

If you want to "sniff" the whole traffic on your interface, you should use a library based on pcap (winpcap for Windows, libpcap for GNU/Linux).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top