Bandwidth throttling in C#
问题 I am developing a program that continually sends a stream of data in the background and I want to allow the user to set a cap for both upload and download limit. I have read up on the token bucket and leaky bucket alghorhithms, and seemingly the latter seems to fit the description since this is not a matter of maximizing the network bandwidth but rather being as unobtrusive as possible. I am however a bit unsure on how I would implement this. A natural approach is to extend the abstract