TsgcWebSocketServer_HTTPAPI › Events › OnStartup
Fires after the HTTP API server has started and is ready to accept connections.
public event TNotifyEventHandler OnStartup;
// delegate void TNotifyEventHandler(TObject Sender)
—
OnStartup is raised in the main thread once the HTTP.SYS endpoint has been registered and the server starts accepting new requests. The Sender parameter is the TsgcWebSocketServer_HTTPAPI instance. It is a convenient place to log the server state or publish startup information; heavy initialization should still be performed before Active is set to True because OnStartup runs after the kernel URL reservation and the listening queue are already in place.
void OnStartup()
{
Console.WriteLine("#server started");
}