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. 0 0 https://community.intersystems.com/post/server-event-browser-websocket-connection-close#comment-110881 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. 0 0 https://community.intersystems.com/post/server-event-browser-websocket-connection-close#comment-72441 Followers:Aohan has no followers yet.Following:Aohan has not followed anybody yet.Global Masters badges:Aohan has no Global Masters badges yet.