0

I am trying to get the available bandwidth from my PC.

Suppose I'm streaming a video at 2 Mbps and my network card is of 100 Mbps, my program should tell me that 98 Mbps is available.

Is it easy to do in C++ or Python? And how can I find the available bandwidth using any of the suggested programming language. Any help will be appreciated.

4

2 回答 2

2

There are many, many factors that will influence the available bandwidth: your hardware (network card, router, WiFi stability, cabling), what you are doing (other downloads, machine load) and what is happening elsewhere (bandwidth to target server, ISP issues, etc.). And all of those can change at any moment in time to make things more interesting. The end result is that there is no way to useful way calculate the available bandwidth. The best you can do is to try downloading (or uploading, depending on what direction you are interested in) some testdata to the target server and see what bandwidth you can use. Keep in mind that TCP has a speeds up over time so you need to run your test for a while to get the real available bandwidth.

于 2012-05-10T11:16:23.960 回答
1

NLoad is written in C++ and supports monitoring bandwidth use on various Unix like operating systems.

You might find some inspiration at https://github.com/revnode/nload

于 2012-05-10T11:22:58.413 回答