限制带宽速度 [英] Limit Bandwidth Speeds

查看:79
本文介绍了限制带宽速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个应用程序,该应用程序将本地文件夹与在线文件夹同步,但是它占用了我的所有带宽,我如何限制该应用程序使用的带宽量? (以编程方式)?

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)?

推荐答案

看看 http://www.codeproject.com/KB/IP/MyDownloader.aspx

他使用的是众所周知的技术,该技术可以在Downloader.Extension \ SpeedLimit中找到

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.

这篇关于限制带宽速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆