TsgcTCPClient › Properties › Active

Active Property

Opens or closes the raw TCP connection to the configured server.

Syntax

property Active: Boolean read GetActive write SetActive default False;

Default Value

False

Remarks

Set Active to True to open a new TCP session using the current Host, Port and TLS settings. Setting the property back to False closes the connection gracefully. No WebSocket handshake is performed — the client exchanges raw TCP (or TLS) bytes directly with the peer. Use Active rather than the low-level Connected method to check whether the client has an open session; Active is safer because it does not invoke Indy's internal connected routine, which can lock the thread.

Example


oTCP := TsgcTCPClient.Create(nil);
oTCP.Host := 'www.esegece.com';
oTCP.Port := 2053;
oTCP.Active := true;

Back to Properties