Last post Aug 23, 2019 10:17 AM by mgebhard
Aug 23, 2019 09:38 AM|kengkit|LINK
Hi guys. I have read an article saying that the main usage of Response.IsClientConnected would be for optimizing the delivery of long processes. For example, if i had to generate a huge report or something, you might run the report in a
separate thread and then periodically check to see if the user is still connected. If not, you could kill this long-running process so that it is not running needlessly since the user is no longer expecting a response.
So my question is how can i separate thread and do periodically check in asp.net?
Dim customer as New DBcustomer
Dim DT as new DataTable
DT = customer.return_customer("All")
Me.GridView.DataSource = DT.DefaultView
Aug 23, 2019 10:17 AM|mgebhard|LINK
IMHO, it does not make sense to start another thread if the user is waiting for a response. You can do the Response.IsClientConnected check in the current thread.
If you started a new background thread and returned a response, then Response.IsClientConnected is irrelevant.