I have a Visual Studio 2019 Visual Basic forms application that communicates using a Client Socket with another PC (the other PC is the Socket server). The Client will periodically (once every 2 seconds) send a message to the Server and expect a reply in under 1 second.
Everything works fine until I power down the other PC (the server). The power down is abrupt and does not allow for any notification that its shutting down. It's like pulling the Ethernet Cable.
When that happens the main form (the only form) in my application appears to freeze up. I'm running the application in debug mode so to be more accurate Visual Studio itself does not freeze up, only the form. I can do a CTR-Break to stop and close the form.
I'm not sure whats happening with the form exactly but I'm wondering if perhaps its because the Client is operating in a blocking mode and perhaps (I don't know) the socket is operating on a different thread in the background. My theory is that the thread is waiting for something but not getting it and so it never returns to the forms application giving the appearance that the form is frozen.
Any help would be greatly appreciated.