TsgcTCPClient › Properties › LingerState

LingerState Property

Configures the SO_LINGER socket option used when the client closes the connection.

Syntax

property LingerState: Integer read FLingerState write FLingerState;

Default Value

-1 (system default)

Remarks

A value of -1 leaves SO_LINGER untouched and uses the operating-system default (close() returns immediately while the kernel drains any queued bytes in the background). Set LingerState to 0 to force an abortive close that discards any unsent data and sends a TCP RST; a positive number of seconds enables the linger option so that close() blocks until the queued data has been transmitted or the specified timeout elapses.

Example


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

Back to Properties