bandwidth

Limit Bandwidth Speeds

拈花ヽ惹草 提交于 2019-11-30 22:17:55
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)? Polity 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

Calculating available bandwidth

╄→尐↘猪︶ㄣ 提交于 2019-11-30 20:27:54
问题 I need write a code in C++ in Windows , to calculate available bandwidth. I'm currently planing to use spruce algorithm. i wanted to know is there any code available for this algorithm in windows . or is there any other technique to get the internet bandwidth. 回答1: Searching for "spruce algorithm" gives me this result http://iris.csail.mit.edu/spruce/ : Spruce is a tool for measuring available bandwidth over Internet paths. Download source code It's GPLv2 and written in C - should be easily

Python Requests/urllib — monitoring bandwidth usage

蹲街弑〆低调 提交于 2019-11-30 17:44:33
I want to log the total bytes downloaded and uploaded by my Python script. total_downloaded_bytes = 0 def bandwidth_hook(r, *args, **kwargs): global total_downloaded_bytes total_downloaded_bytes += len(r.content) req = requests.session() req.hooks = {'response': bandwidth_hook} The above code doesn't take into account HTTP compression (if I'm right) and the size of headers. Is there a way to count total uploaded and downloaded bytes from a requests.session? If not, what about a script-wide count? Martijn Pieters You can access the r.request object to calculate outgoing bytes, and you can

How to test a site for low bandwidth?

99封情书 提交于 2019-11-30 13:55:42
I'm developing a web application for mobile browsers. Right now most of development is done on local machines (with local apache) and I'd like to test how it behaves in low bandwidth and even high latency environments. I don't need to use apache as there is little server side things for the moment. Do you know any good tool? You may want to give Sloppy a try. UPDATE: @SamSaffron posted a cool gist: https://gist.github.com/2132065 to inject 300ms latency into the network stack #!/bin/sh ipfw -q -f flush ipfw add pipe 1 in ipfw add pipe 2 out ipfw pipe 1 config bw 512Kbit/s queue 30 delay 150ms

Is it worth the effort to try to reduce JSON size?

放肆的年华 提交于 2019-11-30 11:57:22
问题 I am submitting relatively lots of data from a mobile application (up to 1000 JSON objects), that I would normally encode like this: [{ id: 12, score: 34, interval: 5678, sub: 9012 }, { id: ... }, ...] I could make the payload smaller by submitting an array of arrays instead: [[12, 34, 5678, 9012], [...], ...] to save some space on the property names, and recreate the objects on the server (as the schema is fixed, or at least it is a contract between the server and the client). The payload in

Limit Bandwidth Speeds

别说谁变了你拦得住时间么 提交于 2019-11-30 05:45:29
问题 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)? 回答1: 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

Is it worth the effort to try to reduce JSON size?

梦想与她 提交于 2019-11-30 01:48:29
I am submitting relatively lots of data from a mobile application (up to 1000 JSON objects), that I would normally encode like this: [{ id: 12, score: 34, interval: 5678, sub: 9012 }, { id: ... }, ...] I could make the payload smaller by submitting an array of arrays instead: [[12, 34, 5678, 9012], [...], ...] to save some space on the property names, and recreate the objects on the server (as the schema is fixed, or at least it is a contract between the server and the client). The payload in then submitted in a POST request, most likely over a 3G connection (or could be wifi). It looks like I

How to test a site for low bandwidth?

安稳与你 提交于 2019-11-29 20:22:38
问题 I'm developing a web application for mobile browsers. Right now most of development is done on local machines (with local apache) and I'd like to test how it behaves in low bandwidth and even high latency environments. I don't need to use apache as there is little server side things for the moment. Do you know any good tool? 回答1: You may want to give Sloppy a try. UPDATE: @SamSaffron posted a cool gist: https://gist.github.com/2132065 to inject 300ms latency into the network stack #!/bin/sh

One big query vs. many small ones?

谁说胖子不能爱 提交于 2019-11-29 13:53:33
I'd like to know, which option is the most expensive in terms of bandwith and overall efficiency. Let's say I have a class Client in my application and a table client in my database. Is it better to have one static function Client.getById that retrieves the whole client record or many ( Client.getNameById , Client.getMobileNumberById , etc.) that retrieve individual fields? If a single record has a lot of fields and I end up using one or two in the current script, is it still better to retrieve everything and decide inside the application what to do with all the data? I'm using PHP and MySQL

For UDP broadcast gurus: Problems achieving high-bandwidth audio UDP broadcast over WiFi (802.11N and 802.11G)

假装没事ソ 提交于 2019-11-29 09:54:50
问题 I'm attempting to send multichannel audio over WiFi from one server to multiple client computers using UDP broadcast on a private network. I'm using software called Pure Data, with a UDP broadcast tool called netsend~ and netreceive~. The code is here: http://www.remu.fr/sound-delta/netsend~/ To cut a long story short, I'm able to achieve sending 9 channels to one client computer in a point-to-point network, but when I try to do broadcast to 2 clients (haven't yet tried more), I get no sound.