TsgcWSPClient_MQTTEventi › OnMQTTPubRel

OnMQTTPubRel Evento

Si attiva nella terza fase dell'handshake QoS 2 quando viene ricevuto un PUBREL.

Sintassi

property OnMQTTPubRel: TsgcWSMQTTPubRelEvent;
// TsgcWSMQTTPubRelEvent = procedure(Connection: TsgcWSConnection; aPacketIdentifier: Word; ReasonCode: Integer; const ReasonName: String; PubRelProperties: TsgcWSMQTTPUBRELProperties) of object

Valore predefinito

Note

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.

Esempio

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;

Torna agli Eventi