TsgcHTTP2Client › Methods › Close
Performs a graceful HTTP/2 shutdown by sending a GOAWAY frame to the server.
procedure Close(aCode: Th2ErrorCodes = h2erNO_ERROR; const aDescription: String = '');
| Name | Type | Description |
|---|---|---|
aCode | Th2ErrorCodes | HTTP/2 error code written into the GOAWAY frame. Defaults to h2erNO_ERROR to signal a clean shutdown. |
aDescription | const String | Optional debug text copied into the Additional Debug Data field of the GOAWAY frame; pass an empty string when no reason is required. |
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.
oClient.Close(h2erNO_ERROR, 'client shutting down');