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 8579051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:31:48+00:00 2026-06-11T20:31:48+00:00

Is it possible to send more than two HTTP requests concurrently in WinRT? I’m

  • 0

Is it possible to send more than two HTTP requests concurrently in WinRT? I’m trying to load multiple JSON documents from a server and HttpWebRequest fails to respond after the second call. Here is a sample snippet that illustrates this:

protected async override void OnNavigatedTo(NavigationEventArgs e)
{
    const string url = "http://www.bom.gov.au/fwo/IDV60901/IDV60901.94868.json";
    const int iterations = 3;

    var tasks = new List<Task>();
    var ticks = DateTime.Now.Ticks;

    for (var i = 0; i < iterations; i++)
    {
        // Create unique URL by appending a generated number.
        var uniqueUrl = string.Format("{0}?v={1}", url, (i + ticks));

        // Create the request.
        var request = WebRequest.CreateHttp(uniqueUrl);

        // Create the async task and store it for later.
        var task = request.GetResponseAsync();

        tasks.Add(task);
    }

    // Await all tasks in collection.
    await Task.WhenAll(tasks);



    Debugger.Break(); // <----- This will never break when iterations > 2
}

Put this code in a blank MainPage.xaml.cs and play around with the iterations value. If you set it to 2, then it works. Anything above that, it will fail.

NOTE :: Do not use Fiddler when testing this. Fiddler does something funny and it allows all these connections to go through. I don’t know how nor why. You can test this yourself. If you run the code above with fiddler open, then success.

NOTE :: This is not real code. I’m only using this example to illustrate the issue.

  • 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-06-11T20:31:50+00:00Added an answer on June 11, 2026 at 8:31 pm

    I haven’t tried using the WebClient API in WinRT, I’ve only used the HttpClient API (which I’m using quite extensively in my application).

    This code works:

    const string url = "http://www.bom.gov.au/fwo/IDV60901/IDV60901.94868.json";
    const int iterations = 10;
    
    var tasks = new List<Task<HttpResponseMessage>>();
    var ticks = DateTime.Now.Ticks;
    
    for (var i = 0; i < iterations; i++)
    {
        // Create unique URL by appending a generated number.
        var uniqueUrl = string.Format("{0}?v={1}", url, (i + ticks));
    
        var handler = new HttpClientHandler();
    
        var client = new HttpClient(handler)
                            {
                                BaseAddress = new Uri(uniqueUrl)
                            };
    
        var task = client.GetAsync(client.BaseAddress);
    
        tasks.Add(task);
    }
    
    // Await all tasks in collection.
    await Task.WhenAll(tasks);
    

    It is a bit more tedious to get out the response body though as you need to do an async read of all the responses like so:

    var responseTasks = tasks.Select(task => task.Result.Content.ReadAsStringAsync());
    
    await Task.WhenAll(responseTasks);
    

    Then you can iterate through the responseTask objects and take their result.

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

Sidebar

Related Questions

I'm trying to send a large amount of data (more than 50 MB) using
Does anybody know, If it's possible, and how to send SMS to more than
Is it possible to send pre-compressed files that are contained within an EARfile? More
is it possible to send back two parameters when calling a delegate method? I
Is it possible to send 100 Continue HTTP status code, and then later some
Is possible to create more than one email profile on email router in Dynamic
Is it possible to open a multiple send and receive ports for the same
Is it possible to send an intent only to one service when this one
Is it possible to send data to another C++ program, without being able to
is it possible to send 2 consecutive TCP packets out as seen in this

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.