method
quic.QuicSession.close
Initiate a graceful close of the session. Existing streams will be allowed to complete but no new streams will be opened. Once all streams have closed, the session will be destroyed. The returned promise will be fulfilled once the session has been destroyed. If a non-zero code is specified, the promise will reject with an ERR_QUIC_TRANSPORT_ERROR or ERR_QUIC_APPLICATION_ERROR depending on the type.
Referenced types
interface SessionDestroyOptions
- code?: number | bigint
The error code to include in the
CONNECTION_CLOSEframe sent to the peer. Default:0(no error). - reason?: string
An optional human-readable reason string included in the
CONNECTION_CLOSEframe. Per RFC 9000, this is for diagnostic purposes only and should not be used for machine-readable error descriptions. - type?: 'transport' | 'application'
Either
'transport'or'application'. Determines the error code namespace used in theCONNECTION_CLOSEframe. When'transport'(the default), the frame type is0x1cand the code is interpreted as a QUIC transport error. When'application', the frame type is0x1dand the code is application-specific. Default:'transport'.