[p2p-hackers] Control network file transfer rate

Michael Parker mgp at ucla.edu
Thu Feb 23 19:05:51 UTC 2006


IIRC, a long time ago while looking through the Azureus source code I 
saw a token bucket implementation to control the upload rate. See here:

http://en.wikipedia.org/wiki/Token_bucket

Although if you're just interested in ready-to-use source code, the 
previous replies are much more helpful :)

- Mike Parker


Quoting Yifei Zeng <mac.ibook at gmail.com>:

> Hi all.
>
> I am writing a peer-to-peer file sharing application in Java.
>
> Could someone help me with how to control the download/upload rate of 
>  the file transfer (practically) through internet?
>
> just like the BitTorrent clients (Bitcomet, Azureus), most of them  
> have the function for the user to set the download / upload rate 
> limit.
>
> How should I do in java to achieve this? Can someone please give me  
> some ideas or hints?
>
> I am currently using non-blocking IO and socket and for each file  
> transfer between two peers there is a non-blocking socket associated  
> with it. And my application only has single thread to achieve all  
> socket read / write request.
>
> Thanks
>
> Yifei
> _______________________________________________
> p2p-hackers mailing list
> p2p-hackers at zgp.org
> http://zgp.org/mailman/listinfo/p2p-hackers
> _______________________________________________
> Here is a web page listing P2P Conferences:
> http://www.neurogrid.net/twiki/bin/view/Main/PeerToPeerConferences
>





More information about the P2p-hackers mailing list