Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limit Bandwidth Speeds

Tags:

c#

bandwidth

i wrote an app that sync's local folders with online folders, but it eats all my bandwidth, how can i limit the amount of bandwidth the app use? (programatically)?

like image 997
stoic Avatar asked Nov 05 '22 12:11

stoic


1 Answers

Take a look at http://www.codeproject.com/KB/IP/MyDownloader.aspx

He's using the well known technique which can be found in Downloader.Extension\SpeedLimit

Basically, before more data is read of a stream, a check is performed on how much data has actually been read since the previous iteration . If that rate exceeds the max rate, then the read command is suspended for a very short time and the check is repeated. Most applications use this technique.

like image 175
Polity Avatar answered Nov 14 '22 22:11

Polity