This topic is now archived and is closed to further replies.

bandwidth control

This topic is 5439 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

a) I think you can throttle bandwidth using QoS (Quality of Service), but this has to be supported by the OS and the router, etc...

b) Another more portable way to do it is to just keep tally of how many bytes are sent (this is returned by send() and recv() ) and the amount of time it has been sending/recving (using any number of timer functions).. bytes/time (in seconds) = Bps ... if the Bps goes over a certain threshold either don''t send the data until it goes beneath the threshold or calculate how many bytes you can send (Target Bytes/Sec * Num Seconds - Bytes Sent = How many bytes you can send without going over target Bps) and just send that many bytes..

It''s certainly extra work either way...

Share this post

Link to post
Share on other sites