Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In which cases does HttpResponse.SupportsAsyncFlush return false

There is a property on HttpResponse object named SupportsAsyncFlush which returns the value of the HttpWorkerRequest.SupportsAsyncFlush property according to MSDN. However, when I look at the HttpWorkerRequest.SupportsAsyncFlush property through a decompiler, I can see that it's already returning false which makes me think that I am missing something.

As the HttpWorkerRequest is an abstract class, I think that the hosting layer (IIS, etc) implements this class and overrides the HttpWorkerRequest.SupportsAsyncFlush virtual property if needed? if this is the case, in which cases does HttpContext.Response.SupportsAsyncFlush return false under IIS?

like image 838
tugberk Avatar asked May 01 '26 15:05

tugberk


1 Answers

All IIS 7.0+ hosts override this property to return true. If a custom host is being used, then the host will have to go out of its way to override the property to return true. For example, the Cassini host doesn't support async flushes so doesn't override the property.

tl;dr: If you're running in IIS or IIS Express, you are guaranteed that this will return true.

like image 121
Levi Avatar answered May 03 '26 08:05

Levi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!