Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 677113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:00:14+00:00 2026-05-14T01:00:14+00:00

I have a big problem dealing with data I try to download in my

  • 0

I have a big problem dealing with data I try to download in my Application over the internet via HttpWebResponse. My code looks like that:

myWebRequest.Timeout = 10000; 

using (HttpWebResponse myWebResponse = (HttpWebResponse)myWebRequest.GetResponse())
{
     using (Stream ReceiveStream = myWebResponse.GetResponseStream())
     {
         Encoding encode = Encoding.GetEncoding("utf-8");
         StreamReader readStream = new StreamReader(ReceiveStream, encode);
         // Read 1024 characters at a time.
         Char[] read = new Char[1024];

         int count = readStream.Read(read, 0, 1024);

         int break_counter = 0;
         while (count > 0 && break_counter < 10000)
         {
             String str = new String(read, 0, count);
             buffer += str;
             count = readStream.Read(read, 0, 1024);
             break_counter++;
         }
    }
}

This code runs in a few instances in separated threads so it’s a little bit hard to debug. The problem is this method got stuck and I blame it on the poor connection to the data.

As you can see I already set a timeout and was hoping the code would just terminate after the timeout time has expired. It does not! At least not all the time. Sometimes I get a WebException/Timeout but a few times it just got stuck.

What is a timeout exactly? When is it called?
Lets say the HttpWebResponse starts to receive data but it got stuck somewhere in the middle of transmission. Do I get a timeout? For me it looks like I don’t because my application got stuck too and no timeout exception is raised.

What can I do to patch this up or how can I get further information about what is going wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:00:14+00:00Added an answer on May 14, 2026 at 1:00 am

    Try setting HttpWebRequest.ReadWriteTimeout Property

    The number of milliseconds before the
    writing or reading times out. The
    default value is 300,000 milliseconds
    (5 minutes).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have big problem. Lets look on the code below: protected void Application_AuthenticateRequest(object sender,
I've created a form with code and I have a big problem. Every element
i have a big web application running in perl CGI. It's running ok, it's
I have this big data-entry sort of page, a table kind of layout using
I have a big lump of binary data in a char[] array which I
I have to take over and improve/finish some code that transforms Java objects from
I have a big problem with my SMTP server for sending emails. It's down
I really seem to have a big problem here. I'm using MySQL to store
I'm using sqlalchemy. The question is simple, but I have a big problem, because
Good day, Stackoverflow! I have a little (big) problem with porting one of my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.