TsgcWSPClient_AMQP1 › Events › OnAMQPDisconnect
Fires after the underlying transport (WebSocket or TCP) has closed, reporting the close code.
property OnAMQPDisconnect: TsgcAMQP1DisconnectEvent;
// TsgcAMQP1DisconnectEvent = procedure(Sender: TObject; const aCode: Integer) of object
—
Raised from the internal DoEventDisconnect hook once the transport has gone away. aCode is the close code surfaced by the transport: a WebSocket close code (1000, 1006, 1011, ...) when running over WebSockets, or 0/transport-specific value when running over raw TCP. At this point any cached session and link state has been cleared; the container is free to be reused by setting the underlying client's Active := True again. Contrast with OnAMQPClose, which reports the AMQP-level Close frame.
procedure TForm1.oAMQP1AMQPDisconnect(Sender: TObject; const aCode: Integer);
begin
DoLog(Format('#AMQP1 transport disconnected (code=%d)', [aCode]));
end;