TsgcWSPServer_sgc › 事件 › OnAcknowledgment
当客户端确认收到 QoS 级别 1 或级别 2 消息时触发。
property OnAcknowledgment: TsgcWSAcknowledgment;
// TsgcWSAcknowledgment = procedure(Connection: TsgcWSConnection; const Id: string) of object
—
仅在 QoS 设置为级别 1 或级别 2 时触发。Id 参数与原始出站消息的 Id 匹配,允许服务器将确认与其待处理列表关联。事件触发之前,服务器已从重发队列中删除该消息,因此处理程序纯粹是信息性的(日志记录、指标或应用层记账)。
procedure TForm1.oProtocolAcknowledgment(Connection: TsgcWSConnection; const Id: string);
begin
Memo1.Lines.Add(Format('ack from %s for %s', [Connection.Guid, Id]));
end;