TsgcWSPClient_AMQP › Methods › CloseEx
Closes the AMQP connection synchronously and returns True when the broker acknowledged the close.
function CloseEx(aReplyCode: Word; const aReplyText: string; aFailClassId: TsgcAMQPClass = amqpClassNone; aFailMethodId: TsgcAMQPMethod = amqpMethodNone): Boolean;
| Name | Type | Description |
|---|---|---|
aReplyCode | Word | AMQP reply-code returned to the broker (use 200 for a clean close). |
aReplyText | const string | Human-readable reply-text returned to the broker. |
aFailClassId | TsgcAMQPClass | AMQP class-id of the offending method when closing after an error (amqpClassNone for a normal close). |
aFailMethodId | TsgcAMQPMethod | AMQP method-id of the offending method when closing after an error (amqpMethodNone for a normal close). |
True when the broker acknowledged the close, False on timeout or error. (Boolean)
Extended variant of Close that waits for connection.close-ok before returning. Use when the calling code needs to be certain the close handshake completed before tearing down resources.
if sgcWSPClient_AMQP1.CloseEx(200, 'OK') then
// connection cleanly closed