TsgcWSPClient_MQTT › Eventi › OnMQTTPubRel
Si attiva nella terza fase dell'handshake QoS 2 quando viene ricevuto un PUBREL.
property OnMQTTPubRel: TsgcWSMQTTPubRelEvent;
// TsgcWSMQTTPubRelEvent = procedure(Connection: TsgcWSConnection; aPacketIdentifier: Word; ReasonCode: Integer; const ReasonName: String; PubRelProperties: TsgcWSMQTTPUBRELProperties) of object
—
Terzo passaggio dello scambio QoS 2 (PUBLISH → PUBREC → PUBREL → PUBCOMP). Questo evento si attiva quando viene ricevuto un pacchetto PUBREL dal broker nell'ambito del flusso di consegna esattamente una volta per un messaggio che il broker sta consegnando a questo client. Il componente risponde automaticamente con PUBCOMP per chiudere l'handshake. Parametri:
Utilizzare questo evento principalmente per la registrazione / diagnostica; non è richiesta alcuna azione dall'applicazione.
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;