What happens to Cancelled HTTP Requests

G

Guest

What happens to a cancelled http request from the server perspective?

Here's the scenario.

I request a page from the web server and page requires lot of processing.
Before the response comes to the browser I either hit the Stop button on the
browser or moved on to another page.

Now at the server, does it continue to process the request? or does ASP.Net
terminate the processing because the TCP connection of the HTTP requests is
longer active?

Whats the story here?

Thanks a lot.

Chandra
 
S

Scott Allen

ASP.NET doesn't know that the user hit the stop button, or if they
closed the browser - it will continue to toil away at the request in
hopes it can bring happiness to the user.

If you have a really processing intensive section of code you can call
Response.IsClientConnected in code and skip all the hard work if the
property returns false. I would not litter the code by placing these
checks everywhere though, because it would be the exceptional case
that a client has disconnected, and also because I have some doubts as
to the accuracy of the property.

HTH,
 
B

bruce barker

Response.IsClientConnected will not detect the stop until data is sent to
the client (as http over tcp/ip does not do heartbeats). you would have to
turn page buffering off, and flush responses doing the processing to detect
earlier.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top