TsgcWSPClient_MQTT › 이벤트 › OnMQTTPubAck
QoS 1 publish(PUBLISH → PUBACK)에 대해 PUBACK이 수신될 때 발생합니다.
property OnMQTTPubAck: TsgcWSMQTTPubAckEvent;
// TsgcWSMQTTPubAckEvent = procedure(Connection: TsgcWSConnection; aPacketIdentifier: Word; ReasonCode: Integer; const ReasonName: String; PubAckProperties: TsgcWSMQTTPUBACKProperties) of object
—
QoS 1 전달은 두 패킷 핸드셰이크를 사용합니다: 클라이언트가 PUBLISH를 전송하고 브로커가 PUBACK로 응답하면, 그 시점에서 메시지는 최소 한 번 전달된 것으로 간주됩니다. 이 이벤트는 PUBACK 단계를 확인합니다. 매개변수:
QoS 0의 경우 확인이 전송되지 않으며 이 이벤트는 발생하지 않습니다. QoS 2의 경우 OnMQTTPubRec / OnMQTTPubRel / OnMQTTPubComp를 참조하십시오.
procedure TForm1.MQTTPubAck(Connection: TsgcWSConnection;
aPacketIdentifier: Word; ReasonCode: Integer;
const ReasonName: String;
PubAckProperties: TsgcWSMQTTPUBACKProperties);
begin
Memo1.Lines.Add(Format('PUBACK id=%d code=%d (%s)',
[aPacketIdentifier, ReasonCode, ReasonName]));
end;