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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With