TsgcQUICClient › Methods › Disconnect

Disconnect Method

Closes the QUIC connection to the server.

Syntax

function Disconnect(aTimeout: Integer = 10000): Boolean;

Parameters

NameTypeDescription
aTimeoutIntegerMaximum time in milliseconds to wait for the connection to close. Defaults to 10000 (10 seconds).

Return Value

True if the QUIC connection was closed before the timeout expired, otherwise False. (Boolean)

Remarks

Disconnect closes the QUIC connection to the server and blocks until it has been closed or aTimeout elapses. When the connection is closed the OnQUICDisconnect event fires. Use Stop instead when a non-blocking close is preferred. Setting Active to False performs the equivalent close through the property.

Upgrading. In earlier builds this contract did not hold in practice. The close went through an internal wait for a reply the server was under no obligation to send, so the call blocked instead of returning and reported failure even after a clean close. It now returns as described above, and True means the connection really was closed within aTimeout.

Example


oClient.Disconnect;

Back to Methods