Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I limit download/upload speed within my application?

Tags:

c#

I want to limit the bandwidth of all downloads and uploads to be performed in the application.

The reason is that the application runs code not written by me. I don't want some malicious code to over use the network resource.

like image 984
Erik Sapir Avatar asked Sep 13 '11 11:09

Erik Sapir


People also ask

How can I limit my upload Speed?

The easiest method to limit your upload speeds on a computer is with a third-party application to limit network transfer rates. Below are examples of software programs designed to limit the upload speed. NetLimiter official website. Throttled Pro official website (runs on macOS, FreeBSD, or Linux).

Can we limit download Speed?

You can limit your internet WiFi speed usage through the QoS on your router. Just configure the QoS to set up the priorities for the different types of internet priorities so that there are certain internet uses that are not as prioritized as others. Installing traffic-shaping software also helps.


1 Answers

Here is a link on SO that covers a similar question:
How can I rate limit an upload using TcpClient?

In a nutshell, you need to detect the bandwidth of the connected socket and then sleep overly fast connections.

Here is a link to a CodeProject source that makes use of throttling techniques:
http://www.codeproject.com/KB/IP/Bandwidth_throttling.aspx

like image 138
Joel Etherton Avatar answered Sep 27 '22 17:09

Joel Etherton