TsgcWSPServer_sgcEvents › OnAcknowledgment

OnAcknowledgment Event

Fires when a client confirms receipt of a QoS Level 1 or Level 2 message.

Syntax

property OnAcknowledgment: TsgcWSAcknowledgment;
// TsgcWSAcknowledgment = procedure(Connection: TsgcWSConnection; const Id: string) of object

Default Value

Remarks

Only raised when QoS is set to Level 1 or Level 2. The Id argument matches the Id of the original outgoing message, allowing the server to correlate the acknowledgment with its pending list. Before the event fires the server has already removed the message from the resend queue, so the handler is purely informational (logging, metrics or application-level bookkeeping).

Example

procedure TForm1.oProtocolAcknowledgment(Connection: TsgcWSConnection; const Id: string);
begin
  Memo1.Lines.Add(Format('ack from %s for %s', [Connection.Guid, Id]));
end;

Back to Events