TsgcHTTP3Server › Methods › SendGoAway
Sends a GOAWAY frame to gracefully wind down an HTTP/3 connection.
procedure SendGoAway(const aQUICConn: TsgcQUICServerConnection; aLastStreamId: Int64); virtual;
| Name | Type | Description |
|---|---|---|
aQUICConn | const TsgcQUICServerConnection | QUIC connection that will be wound down. |
aLastStreamId | Int64 | Identifier of the last request stream the server is prepared to process. Requests on higher stream ids are not handled and may be retried by the client on a new connection. |
SendGoAway emits an HTTP/3 GOAWAY frame (RFC 9114 section 5.2) to begin a graceful shutdown of one connection. It tells the peer the highest-numbered request stream the server will still handle, so the client stops opening new request streams and can safely retry anything beyond aLastStreamId elsewhere without risking a duplicated non-idempotent request.
GOAWAY is advisory, not a close. It does not terminate the connection, cancel in-flight requests or stop the listener: requests at or below aLastStreamId continue to completion, and it is the application that decides when to close. The usual drain sequence is to send GOAWAY, let outstanding requests finish, and then Stop the server or let the client disconnect. This is what makes a clean restart or the removal of a node from a pool possible without resetting active requests.
The frame is written on the connection's default stream. It is sent per connection, so draining a whole server means calling SendGoAway for each connection currently served.
.NET difference. The .NET implementation declares SendGoAway with a connection id string instead of a connection object, and the method is currently a no-op, so no GOAWAY frame is written. The HTTP/3 control-stream framing does exist in .NET, and the server uses it to announce its own SETTINGS when WebTransport is enabled, but SendGoAway was never wired to it: the method body ignores its arguments and returns. Use the Delphi/C++Builder implementation to drain a connection with GOAWAY.
// stop accepting new requests, let the ones already in flight finish
oServer.SendGoAway(aConnection, aStreamId);