TsgcWebSocketHTTPServerMethods › Start

Start Method

Starts the HTTP server from a secondary thread so the calling thread is not blocked while bindings are opened.

Syntax

public void Start();

Remarks

Start spawns an internal worker thread that sets Active := True, so the caller (typically the main UI thread) returns immediately instead of freezing while the server binds to its configured ports and initialises TLS/ALPN for HTTP/2. The server is not guaranteed to be listening when Start returns; subscribe to OnStartup to be notified once the server is accepting connections. Set Port, any Bindings, and the TLS / HTTP2 options before calling Start. Use the Active property directly if you prefer a synchronous start that runs on the calling thread.

Example


oServer = new TsgcWebSocketHTTPServer(this);
oServer.Port = 80;
oServer.Start();

Back to Methods