TsgcWSPServer_sgc › Events › OnNotification
클라이언트가 JSON-RPC Notification(Id 없음, 응답 기대 안 함)을 보낼 때 발생합니다.
property OnNotification: TsgcWSNotificationEvent;
// TsgcWSNotificationEvent = procedure(Connection: TsgcWSConnection; const Method, Params: string) of object
—
알림은 RPC 호출과 동일한 method/params envelope을 사용하지만 Id를 전달하지 않아, 클라이언트가 응답을 기대하지 않음을 알립니다. Id가 있는 호출은 대신 OnRPC로 디스패치됩니다. Params는 매개변수 객체/배열의 원시 JSON 텍스트입니다 — 사용하기 전에 JSON reader로 파싱하십시오.
procedure TForm1.oProtocolNotification(Connection: TsgcWSConnection;
const Method, Params: string);
begin
Memo1.Lines.Add(Format('%s -> %s(%s)', [Connection.Guid, Method, Params]));
end;