After googling, I found out there's no method to limit download speed in WebClient
class.
So now I'm thinking of putting Thread.Sleep()
in the method of DownloadFileAsync()
's DownloadProgressChangedEventHandler
.
I guess this way would work anyway but I'm not sure if I can still call it bandwidth throttling.
Let's say there are two downloaders. The first one downloads 50Bytes per sec. The second one downloads 100Bytes per 2 secs. Then both are 50Bps.
As you know, what I'm trying to do with WebClient
is the second way. After downloading 100bytes, sleep for a sec, and then download 100Bytes, and sleep for a sec again...
Will my approach be okay?