Qt program: How to check internet upload and download speed ?
-
Hello,
I am new in Qt programming. I need to create an widget which will calculate and show internet speed (upload and download) on my machine.
Please share me the logic to achieve it using any Qt library or any API.
If possible please provide example code, that will more helpful for me.Thanks in advance
Regards
developer87 -
Hi mrdebug,
Thanks for quick reply, I found same explanation that try to transmit something on server, but not really getting how to achieve and logic to calculate speed via Qt program.
If possible please share me any sample code to get exact idea of this logic implementation. I would be more helpful for me.
Thanks.
-
Hi, you can use the QNetworkAccessManager or a custom QTcpSocket to do the speed test. Look at the examples in the Qt doc or the networking examples.
If you don't want to download and upload a file you can also try determining the actual down and upload rates form your router via UPnP. Don't ask me how to do that, but it is possible, of course only if you have a network router with UPnP enabled so it might not work all the time and testing the speed is more reliable.