TsgcWebSocketServer_HTTPAPIMethods › Start

Start Method

Starts the HTTP.sys server from a secondary thread so the calling thread is not blocked while URL groups and bindings are registered.

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 HTTP.sys opens the request queue, registers the URL group and configures each binding. The server is not guaranteed to be listening when Start returns; subscribe to OnStartup to be notified once the server is accepting connections. Set Host and Port (or populate Bindings) before calling Start. When BindingOptions.ConfigureSSLCertificate is True the process must run with administrator rights because the URL reservation is created on the fly; disable that option when the URL has already been reserved with netsh to start without elevation. Use the Active property directly if you prefer a synchronous start that runs on the calling thread.

Example


oServer = new TsgcWebSocketServer_HTTPAPI();
oServer.Host = "127.0.0.1";
oServer.Port = 80;
oServer.Start();

Back to Methods