Qt program: How to check internet upload and download speed ?
-
wrote on 1 May 2014, 09:12 last edited by
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 -
wrote on 1 May 2014, 09:54 last edited by
It' very easy. You have to download and upload something from a very fast internet web server.
-
wrote on 1 May 2014, 10:21 last edited by
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.
-
wrote on 1 May 2014, 10:28 last edited by
You have to download a particolar file. After it's will arrived you can calculate de kb/s.
Download from many server is better because somethimes the speed is different. -
wrote on 1 May 2014, 12:32 last edited by
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.
1/5