Pergunta

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.

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top