Click here to Skip to main content
15,887,676 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionHow to create a UI in VS 2008 in visual C++ with .Net Compact framework target platform Pin
Member 1053851522-Jan-14 0:55
Member 1053851522-Jan-14 0:55 
AnswerRe: How to create a UI in VS 2008 in visual C++ with .Net Compact framework target platform Pin
Eddy Vluggen22-Jan-14 8:38
professionalEddy Vluggen22-Jan-14 8:38 
Questionque Pin
harshavardhan1234567821-Jan-14 19:40
harshavardhan1234567821-Jan-14 19:40 
AnswerRe: que Pin
Peter Leow21-Jan-14 19:46
professionalPeter Leow21-Jan-14 19:46 
GeneralRe: que Pin
harshavardhan1234567821-Jan-14 19:50
harshavardhan1234567821-Jan-14 19:50 
GeneralRe: que Pin
thatraja21-Jan-14 20:38
professionalthatraja21-Jan-14 20:38 
AnswerRe: que Pin
Richard MacCutchan21-Jan-14 22:57
mveRichard MacCutchan21-Jan-14 22:57 
Questionhttpwebresponse throttled the response Pin
baaroz118-Jan-14 5:51
baaroz118-Jan-14 5:51 
Hello

I am using HttpWebRequest to let my website users download big files from a remote server.

my website bandwidth is 1 GB (download speed)and the remote server is 1GB download too.

I want to download the files to the clients with speed of 1MB only so my bandwidth will not throttled for each request.

can I control the the download speed from the remote server for each request?

does request.GetResponse() is download the file in full bandwith?
can I throttled it?

would it be okay to try and throttle it with Thread.Sleep?

like this code:

C#
Stream rs = req.GetResponse().GetResponseStream();
      // Send file to client.
      while (fileLength > 0)
      {
          if (Response.IsClientConnected)
          {
              int length = rs.Read(buffer, 0, 10240);

              Response.OutputStream.Write(buffer, 0, length);

               Thread.Sleep(20);

              Response.Flush();

              fileLength = fileLength - length;
          }
          else
          {
              fileLength = -1;
          }
      }

thanks for any help

Baaroz
AnswerRe: httpwebresponse throttled the response Pin
Bernhard Hiller20-Jan-14 3:40
Bernhard Hiller20-Jan-14 3:40 
AnswerRe: httpwebresponse throttled the response Pin
Shameel21-Jan-14 2:04
professionalShameel21-Jan-14 2:04 
Questionapplication not running without visual studio Pin
tgkkishore18-Jan-14 3:23
tgkkishore18-Jan-14 3:23 
AnswerRe: application not running without visual studio Pin
Dave Kreskowiak18-Jan-14 4:06
mveDave Kreskowiak18-Jan-14 4:06 
GeneralRe: application not running without visual studio Pin
tgkkishore18-Jan-14 7:15
tgkkishore18-Jan-14 7:15 
GeneralRe: application not running without visual studio Pin
Dave Kreskowiak18-Jan-14 9:57
mveDave Kreskowiak18-Jan-14 9:57 
GeneralRe: application not running without visual studio Pin
Ron Beyer18-Jan-14 10:03
professionalRon Beyer18-Jan-14 10:03 
GeneralRe: application not running without visual studio Pin
tgkkishore19-Jan-14 1:51
tgkkishore19-Jan-14 1:51 
GeneralRe: application not running without visual studio Pin
Ron Beyer19-Jan-14 3:45
professionalRon Beyer19-Jan-14 3:45 
GeneralRe: application not running without visual studio Pin
tgkkishore20-Jan-14 5:35
tgkkishore20-Jan-14 5:35 
GeneralRe: application not running without visual studio Pin
Ron Beyer20-Jan-14 5:41
professionalRon Beyer20-Jan-14 5:41 
GeneralRe: application not running without visual studio Pin
tgkkishore20-Jan-14 6:13
tgkkishore20-Jan-14 6:13 
GeneralRe: application not running without visual studio Pin
Ron Beyer20-Jan-14 7:49
professionalRon Beyer20-Jan-14 7:49 
GeneralRe: application not running without visual studio Pin
tgkkishore21-Jan-14 4:48
tgkkishore21-Jan-14 4:48 
GeneralRe: application not running without visual studio Pin
Ron Beyer21-Jan-14 5:30
professionalRon Beyer21-Jan-14 5:30 
GeneralRe: application not running without visual studio Pin
tgkkishore22-Jan-14 4:26
tgkkishore22-Jan-14 4:26 
GeneralRe: application not running without visual studio Pin
Ron Beyer22-Jan-14 5:01
professionalRon Beyer22-Jan-14 5:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.