TsgcQUICClient › Methods › Disconnect
Closes the QUIC connection to the server.
function Disconnect(aTimeout: Integer = 10000): Boolean;
| Name | Type | Description |
|---|---|---|
aTimeout | Integer | Maximum time in milliseconds to wait for the connection to close. Defaults to 10000 (10 seconds). |
True if the QUIC connection was closed before the timeout expired, otherwise False. (Boolean)
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.
oClient.Disconnect;