TsgcWebSocketHTTPServerEvents › OnStartup

OnStartup Event

Fires after the server has started and is ready to accept connections.

Syntax

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

Default Value

Remarks

OnStartup is raised in the main thread once the HTTP listener has been bound and the server starts accepting new connections (both HTTP and WebSocket clients on the same port). The Sender parameter is the TsgcWebSocketHTTPServer 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 server is already listening.

Example


void OnStartup()
{
  Console.WriteLine("#http server started");
}

Back to Events