Hi Sven, (I hope this message does arrive. Sorry for the late reply. I have not been able to use the browser-interface for the ML for a number of days now. An admin could not figure this out either. So resorting to actually using a mail ;-)
My architecture is one in which client and server are working fairly independent. A client or server can send the other a message whenever it wants (and there is no response expected). The client is responsible for setting up the connection and keeping it ‘open’ (for the server to reach the client). When the client wants it can however disconnect and reconnect at a later time. The server will still be there (this is not visible in the example of course). Both client and server keep track of messages which can’t be sent when the connection is (temporarily) down. So I have to have a separate process to read messages from the process that writes messages to the WebSocket. In a test I discovered that closing the connection from the client did not get noticed in the process doing the reading. I’d like that process to stop running fairly directly since it is performing some additional logic. Now it takes a timeout. Closing the connection using the specified workaround does get noticed and works for me. But I’m unsure if this is a good approach and there’s the risk it will not work on a next update. A shorter timeout could be a solution but does mean I’m going into a ‘polling’ mode. So I think I prefer my workaround over setting a very short timeout. If you have a better solution though, please let me know. Kind regards, Erik