socket connection bandwith limiting / traffic shaping with ActionScript
Does anyone know of a way t开发者_如何学运维o monitor and/or limit bandwidth usage for a given socket connection in ActionScript 3?
I have an Adobe AIR app from which I need to upload large streams of data. However, due to bandwidth restrictions I want my users to be able to designate how much upstream bandwidth the application can use.
Any ideas?
I don't think it's possible to control the bandwidth usage(might be wrong though) The best thing to do is to split your data into chunks and wait an interval of time between sending each one. The amount of time to wait can be in a directly proportional relation with a "How much bandwidth to use?" slider.
Also take a look as Token buckets: http://en.wikipedia.org/wiki/Token_bucket
精彩评论