Original Post
Hey, I'm wondering how to make my program automatically regulate network usage. What I mean is that I want the program to limit itself to sending a certain number of bytes or packets packets per second, based on available network bandwidth. Presumably, my app will start with some default or maximum setting, and then scale down as packet loss and/or lag increases. So my questions are: 1) Should I limit the number of packets sent per second (with a fixed max size per packet) or the total number of bytes sent (including packet headers) per second? 2) How does my program choose its default/maximum transmission rate? Should it ask the user to specify what kind of connection they are using and pick an appropriate value or is there some way to automatically determine an appropriate value? (perhaps there should be a single default value which will then be scaled down/up depending on packet loss and/or lag.) 3) *How* should I scale the transmission rate? Based on packet loss, lag, or both? Do I assume that if I'm losing a certain percentage of packets then I am sending too much? How does lag come into play? Will lag go up as network load increases? By how much should I scale the transmission rate? Thanks for all help! - Fuzz