TsgcWebSocketClientMethods › Start

Start Method

Connects to the server asynchronously from a secondary thread so the calling thread is not blocked.

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 TCP handshake and WebSocket upgrade run. The connection is not ready when Start returns; you must wait for the OnConnect event before sending data. The call is ignored when the component is being destroyed. Use Connect if you prefer a blocking call that reports success via its return value.

Example


oClient = new TsgcWebSocketClient();
oClient.Host = "127.0.0.1";
oClient.Port = 80;
oClient.Start();

Back to Methods