HttpWebRequest/Response check for connectivity
-
Hello, how is it possible to check, that the client is connected, before i response to that? I have a lot time-intensive tasks, doing with HttpRequests and i don't want to work in my application and the client is disconnected. Is there any way? Thank you
-
Hello, how is it possible to check, that the client is connected, before i response to that? I have a lot time-intensive tasks, doing with HttpRequests and i don't want to work in my application and the client is disconnected. Is there any way? Thank you
No, because Http doesn't maintain a connection to the server. The connection is only around long enough to request the page and wait for the HTTP response to be returned. If you've got processing during the Response, then you can assume the client is still there. If you're doing the processing outside of the Response, there's no way to reliably determine if the client is still around from the server side.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak