go to post Aohan Dang · Jul 26, 2019 I see. In asynchronous mode, you do have to call EndServer() explicitly to get the OnPostServer() method to execute. This means that you'll have to handle the client closure within your class. One way to do that is to have the client send a special message shortly before closing to indicate that a disconnect is about to happen. You can then handle that message in your WebSocket server class. Another way is to do a Read() and handle the case where $$$CSPWebSocketClosed is returned.
go to post Aohan Dang · Jul 25, 2019 The OnPostServer() method of your WebSocket class should be triggered when the WebSocket closes, provided that you return from the Server() method when that happens.