TsgcSSEClient › Events › OnEvent

OnEvent Event

Fires for every event received from the server.

Syntax

property OnEvent: TsgcSSEEventEvent;
// TsgcSSEEventEvent = procedure(Sender: TObject; const aEvent: TsgcSSEEvent) of object

Default Value

—

Remarks

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.

Example


procedure TForm1.OnSSEEvent(Sender: TObject; const aEvent: TsgcSSEEvent);
begin
  ShowMessage(aEvent.EventType + ': ' + aEvent.Data);
end;

Back to Events