TsgcWSPClient_MQTT이벤트 › OnMQTTPubComp

OnMQTTPubComp 이벤트

PUBCOMP가 수신될 때 QoS 2 핸드셰이크의 네 번째이자 마지막 단계에서 발생합니다.

구문

property OnMQTTPubComp: TsgcWSMQTTPubCompEvent;
// TsgcWSMQTTPubCompEvent = procedure(Connection: TsgcWSConnection; aPacketIdentifier: Word; ReasonCode: Integer; const ReasonName: String; PubCompProperties: TsgcWSMQTTPUBCOMPProperties) of object

기본값

설명

브로커가 QoS 2 핸드셰이크(PUBLISH → PUBREC → PUBREL → PUBCOMP)의 네 번째이자 마지막 패킷인 PUBCOMP를 전송할 때 발생합니다. 이 시점에서 정확히 한 번 전달이 완전히 완료되고 패킷 식별자를 재사용할 수 있습니다. 매개변수:

QoS 2 게시가 종단간으로 완전히 처리되었음을 확인해야 할 때 수신할 이벤트입니다.

예제

procedure TForm1.MQTTPubComp(Connection: TsgcWSConnection;
  aPacketIdentifier: Word; ReasonCode: Integer;
  const ReasonName: String;
  PubCompProperties: TsgcWSMQTTPUBCOMPProperties);
begin
  // QoS 2 delivery is now complete
  Memo1.Lines.Add(Format('PUBCOMP id=%d delivered exactly-once',
    [aPacketIdentifier]));
end;

이벤트로 돌아가기