TsgcSSEClient › Events › OnEvent
Fires for every event received from the server.
property OnEvent: TsgcSSEEventEvent;
// TsgcSSEEventEvent = procedure(Sender: TObject; const aEvent: TsgcSSEEvent) of object
—
The aEvent parameter exposes EventType (the event: field, message when the server does not send one), Data (the data: lines joined with line feeds) and Id (the last event id). Comments and retry: fields do not fire this event.
procedure TForm1.OnSSEEvent(Sender: TObject; const aEvent: TsgcSSEEvent);
begin
ShowMessage(aEvent.EventType + ': ' + aEvent.Data);
end;