TsgcWSPClient_AMQP1Methods › CloseSession

CloseSession Method

Ends an AMQP 1.0 session by sending the End frame on its channel and releasing all links attached to it.

Syntax

function CloseSession(const aName: string; const aOptions: TsgcAMQP1MethodOptions_SessionClose = nil): Boolean;

Parameters

NameTypeDescription
aNameconst stringIdentifier of the session previously returned by CreateSession.
aOptionsconst TsgcAMQP1MethodOptions_SessionCloseOptional options record carrying the error condition attached to the End frame. Pass nil for a clean end.

Return Value

True when the End frame was written, False when the session is unknown or already closed. (Boolean)

Remarks

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.

Example

oAMQP1.CloseSession('session_1');

Back to Methods