سؤال

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