TsgcWebSocketHTTPServerEvents › OnShutdown

OnShutdown Event

Fires after the server has stopped and no more connections are accepted.

Syntax

public event TNotifyEventHandler OnShutdown;
// delegate void TNotifyEventHandler(TObject Sender)

Default Value

Remarks

OnShutdown is raised after the server has stopped listening and all active connections (WebSocket and HTTP) have been closed. The Sender parameter is the TsgcWebSocketHTTPServer instance. Use it to update UI status, flush logs, or release resources associated with the server; note that DisconnectAll is invoked automatically before this event, so the connection list is already empty and active HTTP sessions have been released when the handler runs.

Example


void OnShutdown()
{
  Console.WriteLine("#http server stopped");
}

Back to Events