TsgcWSPServer_sgc › Événements › OnNotification
Se déclenche lorsqu'un client envoie une notification JSON-RPC (sans Id, aucune réponse attendue).
property OnNotification: TsgcWSNotificationEvent;
// TsgcWSNotificationEvent = procedure(Connection: TsgcWSConnection; const Method, Params: string) of object
—
Les notifications utilisent la même enveloppe method/params que les appels RPC mais ne portent pas d'Id, signalant que le client n'attend pas de réponse. Les appels avec un Id sont distribués à OnRPC à la place. Params est le texte JSON brut de l'objet/tableau de paramètres — analysez-le avec un lecteur JSON avant utilisation.
procedure TForm1.oProtocolNotification(Connection: TsgcWSConnection;
const Method, Params: string);
begin
Memo1.Lines.Add(Format('%s -> %s(%s)', [Connection.Guid, Method, Params]));
end;