TsgcWSPServer_sgc › Events › OnNotification
Dispara quando um cliente envia uma Notification JSON-RPC (sem Id, nenhuma resposta esperada).
property OnNotification: TsgcWSNotificationEvent;
// TsgcWSNotificationEvent = procedure(Connection: TsgcWSConnection; const Method, Params: string) of object
—
As notificações usam o mesmo envelope method/params das chamadas RPC, mas não carregam Id, sinalizando que o cliente não espera uma resposta. As chamadas com um Id são despachadas para OnRPC. Params é o texto JSON bruto do objeto/array de parâmetros — faça parse dele com um leitor JSON antes de usar.
procedure TForm1.oProtocolNotification(Connection: TsgcWSConnection;
const Method, Params: string);
begin
Memo1.Lines.Add(Format('%s -> %s(%s)', [Connection.Guid, Method, Params]));
end;