TsgcWSPClient_MQTT › Eventi › OnMQTTUnSubscribe
Viene generato quando viene ricevuto un UNSUBACK in risposta a UnSubscribe; espone i codici di motivo per topic e le UnsubscribeProperties di MQTT 5.
property OnMQTTUnSubscribe: TsgcWSMQTTUnSubscribeEvent;
// TsgcWSMQTTUnSubscribeEvent = procedure(Connection: TsgcWSConnection; aPacketIdentifier: Word; aCodes: TsgcWSUNSUBACKS; UnsubscribeProperties: TsgcWSMQTTUNSUBACKProperties) of object
—
Attivato quando il broker risponde con un UNSUBACK a una richiesta UNSUBSCRIBE. In MQTT 3.1.1 UNSUBACK non contiene uno stato; in MQTT 5.0 contiene un codice motivo per ogni filtro di argomento, in modo che il server possa segnalare "nessuna sottoscrizione esistente" o "non autorizzato" per singolo argomento. Parametri:
procedure TForm1.MQTTUnSubscribe(Connection: TsgcWSConnection;
aPacketIdentifier: Word; aCodes: TsgcWSUNSUBACKS;
UnsubscribeProperties: TsgcWSMQTTUNSUBACKProperties);
var
i: Integer;
begin
for i := 0 to Length(aCodes) - 1 do
Memo1.Lines.Add(Format('unsubscribe %d result=$%x',
[i, aCodes[i]]));
end;