Bandwith Shaping

phil phillip.watts at anvilcom.com
Wed May 4 14:11:33 EDT 2005


flamesrock wrote:

> Just curious - is there an easy way to shape bandwith in python. If I
> wanted to have a max download speed for instance
> 
> -thanks
> 
Interesting normally bandwidth shaping is an IP stack function

in the Kernel.

You are receiving a download within a python program?
And want to slow it down?
You could put a sleep(.01) in your receive loop.
That's about as fine as sleep gets, i've read.

But those packets ( I assume TCP ) are going to stack up somewhere,
the sender is gonna keep trying and retrying.  In other words
you are increasing overall load to someone's router and the
network.
Someone correct me if I'm drunk on this.








More information about the Python-list mailing list