HttpResponse.IsClientConnected not working on IIS 6 RRS feed

  • Question

  • User-1936832475 posted


    On our website, we are finding out users who sometimes seem to make a lot of requests to our aspx pages and disconnect prematurely. We would like to discard these requests without processing them and thus improve website performance. One of the approaches recommended seems to be to use the HttpResponse.IsClientConnected property.

    While this is working perfectly on IIS 7, the same does not seem to work on IIS 6 on Windows Server 2003 SP 2. We are using ASP.NET 3.5. Is this a known issue ?

    Tuesday, November 1, 2011 1:16 AM


  • User-434868552 posted

    @ yhemanth

    FWIW:  (iis 5, not 6 ... do not know if it's a 6 problem too)

    • HttpResponse.IsClientConnected. Consider using the HttpResponse.IsClientConnected property
      to verify if the client is still connected before processing a request and performing expensive server-side operations.
      However, this call may need to go out of process on IIS 5.0 and can be very expensive.
      If you use it, measure whether it actually benefits your scenario.

    also, imho, if the request is not likely to be expensive, it may be better to complete the request ... of course, for that, you need some way to separate inexpensive requests from expensive ones.  while you can shorten the connect time timeout, i'm not sure whether there is any way to specify how much time to allow beyond the connection ... alternatively, you could limit the number of rows returned.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 2, 2011 4:22 PM