TsgcWebSocketServer_HTTPAPIMethods › DisconnectAll

DisconnectAll Method

Disconnects every active WebSocket connection while keeping the HTTP.sys server listening for new connections.

Syntax

public void DisconnectAll();

Remarks

DisconnectAll walks the internal connection list under a shared lock and closes each active WebSocket context, dropping the underlying HTTP.sys request without sending a WebSocket Close frame. The server keeps listening for new incoming connections; this method does not stop or unbind the server. OnDisconnect fires once for each client that is closed. The method is invoked automatically when the server stops, but you can call it at any time to forcibly clear the session table (for example after a configuration change or when draining the pool before a ReStart).

Example


oServer.DisconnectAll();

Back to Methods