TsgcSSEClient › Events › OnClose
Fires when the client stops for good.
property OnClose: TsgcSSENotifyEvent;
// TsgcSSENotifyEvent = procedure(Sender: TObject) of object
—
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.
procedure TForm1.OnSSEClose(Sender: TObject);
begin
ShowMessage('stream closed, last id: ' + TsgcSSEClient(Sender).LastEventId);
end;