TsgcHTTP2ClientMethods › Close

Close Method

Performs a graceful HTTP/2 shutdown by sending a GOAWAY frame to the server.

Syntax

procedure Close(aCode: Th2ErrorCodes = h2erNO_ERROR; const aDescription: String = '');

Parameters

NameTypeDescription
aCodeTh2ErrorCodesHTTP/2 error code written into the GOAWAY frame. Defaults to h2erNO_ERROR to signal a clean shutdown.
aDescriptionconst StringOptional debug text copied into the Additional Debug Data field of the GOAWAY frame; pass an empty string when no reason is required.

Remarks

Unlike Disconnect, Close notifies the peer with a GOAWAY frame so already-opened streams can finish before the transport is torn down. Call it when you want to release the HTTP/2 session cleanly while honouring in-flight requests.

Example

oClient.Close(h2erNO_ERROR, 'client shutting down');

Back to Methods