TsgcSSEClient › Properties › ReconnectOptions
Controls the automatic reconnection after the stream ends or a network error happens.
property ReconnectOptions: TsgcSSEClient_ReconnectOptions read FReconnectOptions write SetReconnectOptions;
Enabled = True, Interval = 3000
The client reconnects when the stream ends or a network error happens, and it sends the Last-Event-ID header so the server can resume the stream. It does not reconnect when the server answers with an HTTP status other than 200, or with a content type other than text/event-stream. A status 204 stops the client without an error.
retry: field sent by the server replaces this value for the rest of the session.The final delay of every attempt can still be changed or cancelled from the OnReconnect event.
oSSE.ReconnectOptions.Enabled := True;
oSSE.ReconnectOptions.Interval := 1000;
oSSE.ReconnectOptions.MaxAttempts := 10;
oSSE.ReconnectOptions.Backoff := True;
oSSE.ReconnectOptions.BackoffMultiplier := 2.0;
oSSE.ReconnectOptions.MaxInterval := 30000;
oSSE.ReconnectOptions.Jitter := 0.2;