Hello. Can I see the network connection status? When sending a reply message ( listenerContext.Response.Close() ) an error pops up
Exception message "Attempt to perform an operation for a non-existent network connection"
Hello. Can I see the network connection status? When sending a reply message ( listenerContext.Response.Close() ) an error pops up
Exception message "Attempt to perform an operation for a non-existent network connection"
Can I see the network connection status?
No, you cannot track the moment when the client stopped responding. The way to do this is to try to send something to the client and catch the exception. Therefore - try/catch
Is it possible not to cause errors?
As the documentation says, the flag IgnoreWriteExceptions is responsible for this opportunity IgnoreWriteExceptions
HttpListener.IgnoreWriteExceptions = true; Source: https://ru.stackoverflow.com/questions/636968/
All Articles
try/catch, throw error and tell you that there is no connection. - Bulson