TsgcWSPClient_MQTT › 事件 › OnMQTTPubRel
在 QoS 2 握手的第三步收到 PUBREL 时触发。
property OnMQTTPubRel: TsgcWSMQTTPubRelEvent;
// TsgcWSMQTTPubRelEvent = procedure(Connection: TsgcWSConnection; aPacketIdentifier: Word; ReasonCode: Integer; const ReasonName: String; PubRelProperties: TsgcWSMQTTPUBRELProperties) of object
—
QoS 2 交换的第三步(PUBLISH → PUBREC → PUBREL → PUBCOMP)。当作为代理向该客户端传递消息的精确一次流程的一部分,从代理收到 PUBREL 数据包时,该事件触发。组件自动响应 PUBCOMP 以关闭握手。参数:
此事件主要用于日志记录/诊断,应用程序无需采取任何操作。
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;