TsgcSSEClient › Events › OnClose

OnClose Event

Fires when the client stops for good.

Syntax

property OnClose: TsgcSSENotifyEvent;
// TsgcSSENotifyEvent = procedure(Sender: TObject) of object

Default Value

—

Remarks

Fires once when the client will not reconnect any more: the server answered 204, a final error happened, reconnection is disabled, MaxAttempts was reached or OnReconnect cancelled it. It is a good place to save LastEventId.

Example


procedure TForm1.OnSSEClose(Sender: TObject);
begin
  ShowMessage('stream closed, last id: ' + TsgcSSEClient(Sender).LastEventId);
end;

Back to Events