TsgcSSEClient › Events › OnError

OnError Event

Fires when a connection attempt or the stream fails.

Syntax

property OnError: TsgcSSEErrorEvent;
// TsgcSSEErrorEvent = procedure(Sender: TObject; const aError: string) of object

Default Value

—

Remarks

Fires with a description of the failure. After a network error or a read timeout the client reconnects. When the server answers with an HTTP status other than 200 and 204, or with a content type other than text/event-stream, the error is final: OnError fires, then OnClose, and the client does not reconnect.

Example


procedure TForm1.OnSSEError(Sender: TObject; const aError: string);
begin
  ShowMessage('SSE error: ' + aError);
end;

Back to Events