TsgcWSPServer_sgcEvents › OnNotification

OnNotification Event

Fires when a client sends a JSON-RPC Notification (no Id, no reply expected).

Syntax

property OnNotification: TsgcWSNotificationEvent;
// TsgcWSNotificationEvent = procedure(Connection: TsgcWSConnection; const Method, Params: string) of object

Default Value

Remarks

Notifications use the same method/params envelope as RPC calls but carry no Id, signalling that the client does not expect a reply. Calls with an Id are dispatched to OnRPC instead. Params is the raw JSON text of the parameter object/array — parse it with a JSON reader before use.

Example

procedure TForm1.oProtocolNotification(Connection: TsgcWSConnection;
  const Method, Params: string);
begin
  Memo1.Lines.Add(Format('%s -> %s(%s)', [Connection.Guid, Method, Params]));
end;

Back to Events