Click here to Skip to main content
15,892,575 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?
Posted
Comments
Sergey Alexandrovich Kryukov 20-Oct-11 20:29pm    
Sadomasochism? (http://en.wikipedia.org/wiki/Sadomasochism)
--SA
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: http://msdn.microsoft.com/en-us/library/debx8sh9.aspx[^]. 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.

—SA
 
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