TsgcWSPClient_AMQP1 › Methods › CloseSession
Ends an AMQP 1.0 session by sending the End frame on its channel and releasing all links attached to it.
function CloseSession(const aName: string; const aOptions: TsgcAMQP1MethodOptions_SessionClose = nil): Boolean;
| Name | Type | Description |
|---|---|---|
aName | const string | Identifier of the session previously returned by CreateSession. |
aOptions | const TsgcAMQP1MethodOptions_SessionClose | Optional options record carrying the error condition attached to the End frame. Pass nil for a clean end. |
True when the End frame was written, False when the session is unknown or already closed. (Boolean)
Writes an end performative on the session's channel, which detaches any sender/receiver links still attached before freeing the channel number for reuse. After the peer mirrors the End frame OnAMQPSessionClose fires. Use aOptions.Error to report a protocol or application error back to the broker; otherwise a clean end is sent. The AMQP 1.0 connection itself stays up — use Close to terminate the container.
oAMQP1.CloseSession('session_1');