Imagine that an HTTP request takes a long time to process in ASP.NET, and an impatient user refreshes the page several times. Now I have several copies of the same request, which makes it respond even slower.
I would like IIS to abort the thread if the client closes the connection while the request is still being processed. IIS can already abort the stream in timeout, but I want the stream to be canceled only if the client closed the connection.
I know that I could check Response.IsClientConnectedwhile the request is progressing, but that would be many checks scattered across hundreds of methods. I just want the thread to be automatically interrupted as soon as the client disconnects.
source
share