Click here to Skip to main content
15,793,535 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello all.
how can i to limit internet download/upload speed?
Sergey Alexandrovich Kryukov 20-Oct-11 20:29pm    
Sadomasochism? (
HosseinRad 22-Oct-11 15:06pm    
i mean that, How to reduce internet bandwidth???

1 solution

Everything is uploaded and downloaded by chunks. Insert System.Threading.Thread.Sleep between then. During the sleep, a thread consumes zero CPU, until waken up by sleep timeout or System.Threading.Thread.Abort yielding CPU cores to other threads.

For download, this must be clear (for one reference you can take a look at my application HttpDownloader I provided here at CodeProject: how to download a file from internet[^]). For HTTP upload (for example), you use the class HttpWebRequest with method "POST". Look at this example:[^]. Now, locate the line in sample code: dataStream.Write (byteArray, 0, byteArray.Length);. If a byte array is big enough, send it in chunks and insert Sleep statement in cycle.

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900