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.

有帮助吗?

解决方案

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).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top