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

  • SEARCH
  • Home
  • 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 4083980
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:22:55+00:00 2026-05-20T18:22:55+00:00

I am using HttpWebRequest.BeginGetRequest() to make 500 asynchronous HTTP requests from a single method.

  • 0

I am using HttpWebRequest.BeginGetRequest() to make 500 asynchronous HTTP requests from a single method. I would like that method to wait until I get a response from all the requests or they timeout.

What is the best way to do this?

I’m currently wrapping the asynchronous calls within a List of Task objects to use Tasks.WaitAll(), but I don’t want to go too far down the rabbit hole before I know that this is a good solution.

Any ideas?

EDIT

I implemented counters, and they work, but I’m curious about using delegates like shown on this page.

Multi-threading and Async Examples

Has anybody done something like this before? Is it overkill?

  • 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-20T18:22:55+00:00Added an answer on May 20, 2026 at 6:22 pm

    Personally I wouldn’t block the thread, it defeats the purpose of the async model.

    If I absolutely had to wait for these web requests to finish before continuing I would instead keep a counter that is incremented each time you get called back on a successful or failed request.

    Check the counter on each callback and if it has hit your desired count then let the thread continue…

    This way you can also keep your UI nice and responsive and perhaps update a counter/progress bar – Even if you’re not kicking these off on the UI thread it’s nice to provide some visual feed back tot he user about what is going on.

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

Sidebar

Related Questions

We're using the HTTPWebRequest objects to make HTTP requests to our application and we're
I'm using HttpWebRequest method to GET data from a specific url that the returned
I'm using HttpWebRequest.BeginGetRequestStream to make POST requests to the remote server. Let's presume that
We have a large library that makes a lot of HTTP calls using HttpWebRequest
I am trying to download an image from URL: http://appworld.blackberry.com/webstore/servedimages/340582.png?t=2 I am using HttpWebRequest
I'm using HttpWebRequest to download data from the website, and I noticed a bug
Any ideas why on some links that I try to access using HttpWebRequest I
I am using the following code to make a HttpWebRequest and render the XML
I am sending a POST request using HTTPWebRequest from the client to the Cassini
I'm trying to log onto the following website using HttpWebRequest: http://mostanmeldung.moessinger.at/login.php Texts are in

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.