By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,696 Members | 2,213 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,696 IT Pros & Developers. It's quick & easy.

What happens to Cancelled HTTP Requests

P: n/a

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
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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,

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 20 Oct 2004 12:57:01 -0700, "Chandra"
<Ch*****@discussions.microsoft.com> wrote:

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


Nov 18 '05 #2

P: n/a
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)
"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:lr********************************@4ax.com...
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,

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 20 Oct 2004 12:57:01 -0700, "Chandra"
<Ch*****@discussions.microsoft.com> wrote:

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 thebrowser or moved on to another page.

Now at the server, does it continue to process the request? or does ASP.Netterminate the processing because the TCP connection of the HTTP requests islonger active?

Whats the story here?

Thanks a lot.

Chandra

Nov 18 '05 #3

P: n/a
Ah, thanks Bruce.

--
Scott
http://www.OdeToCode.com/

On Wed, 20 Oct 2004 15:26:23 -0700, "bruce barker"
<no***********@safeco.com> wrote:
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)


Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.