TsgcWSPClient_MQTT › Events › OnMQTTPubRel
Fires on the third leg of the QoS 2 handshake when a PUBREL is received.
property OnMQTTPubRel: TsgcWSMQTTPubRelEvent;
// TsgcWSMQTTPubRelEvent = procedure(Connection: TsgcWSConnection; aPacketIdentifier: Word; ReasonCode: Integer; const ReasonName: String; PubRelProperties: TsgcWSMQTTPUBRELProperties) of object
—
Third leg of the QoS 2 exchange (PUBLISH → PUBREC → PUBREL → PUBCOMP). This event fires when a PUBREL packet is received from the broker as part of the exactly-once flow for a message the broker is delivering to this client. The component automatically responds with PUBCOMP to close the handshake. Parameters:
Use this event mainly for logging / diagnostics; no application action is required.
procedure TForm1.MQTTPubRel(Connection: TsgcWSConnection;
aPacketIdentifier: Word; ReasonCode: Integer;
const ReasonName: String;
PubRelProperties: TsgcWSMQTTPUBRELProperties);
begin
Memo1.Lines.Add(Format('PUBREL id=%d code=%d',
[aPacketIdentifier, ReasonCode]));
end;