TsgcWSPClient_MQTT › Eventos › OnMQTTPubRel
Se activa en la tercera fase del handshake QoS 2 cuando se recibe un PUBREL.
property OnMQTTPubRel: TsgcWSMQTTPubRelEvent;
// TsgcWSMQTTPubRelEvent = procedure(Connection: TsgcWSConnection; aPacketIdentifier: Word; ReasonCode: Integer; const ReasonName: String; PubRelProperties: TsgcWSMQTTPUBRELProperties) of object
—
Tercer paso del intercambio QoS 2 (PUBLISH → PUBREC → PUBREL → PUBCOMP). Este evento se dispara cuando se recibe un paquete PUBREL del broker como parte del flujo de exactamente una vez para un mensaje que el broker está entregando a este cliente. El componente responde automáticamente con PUBCOMP para cerrar el handshake. Parámetros:
Use este evento principalmente para registro / diagnóstico; no se requiere ninguna acción de la aplicación.
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;