Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What API of Linux/Windows corresponds to limiting network (download/upload) speed?

I'm talking about speed limiting in download managers. For example, in Internet Download Manager there is a an option :

enter image description here

How does it limit speed? I mean, is there some kind of Windows API for that? What if its a Linux application?

like image 551
claws Avatar asked Nov 03 '11 19:11

claws


1 Answers

There are potentially several ways this can be done in Windows:

An application itself can implicitly limit the download speed by monitoring it's own bitrate and sleeping between recv() or read() calls on the socket as needed.

I suspect Internet Download Manager may be installing itself as a local HTTP proxy and configuring the browsers to route all requests through it. And then uses its own networking code to stream the download at an appropriate rate using the simple technique I described above. Look to see if there is an http proxy configured for your browser - that should be a good hint if this is what it is doing.

Another technique is to use a Winsock Layered Service Provider or filter driver. Try typing netsh winsock show catalog from the command line (there are a lot of system ones already installed).

And Winsock itself has an old QOS API that can do "traffic shaping" on a particular socket. (And if memory serves, it even has some system policy support where it can be configured externally outside of the app).

like image 90
selbie Avatar answered Sep 23 '22 02:09

selbie