5

I have a simple action like this:

[HttpGet]
public async Task<string> GetHtml()
{
    Console.WriteLine("Run=======================================================");
    await Task.Delay(5000);
    Console.WriteLine("End=======================================================");
    return "ok";
}

I open three windows quickly, and go to the URL. I expected the result to look like:

Run=======================================================
Run=======================================================
Run=======================================================
End=======================================================
End=======================================================
End=======================================================

But, It's not! Instead, the result was:

Run=======================================================
End=======================================================
Run=======================================================
End=======================================================
Run=======================================================
End=======================================================

In addition, when the first run is finished, the second request begins. Why?

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
mikenlanggio
  • 1,122
  • 1
  • 7
  • 27

1 Answers1

6

So as per my suggestion in the comment you tried with 3 different browsers and it worked as expected. So the issue was from the browser side. Browsers has their limits regarding how they manage connection to the same hostname. See other thread for more info

Orkhan Alikhanov
  • 9,122
  • 3
  • 39
  • 60