TsgcSSEClient › Methods › Open

Open Method

Starts connecting to URL on a background thread.

Syntax

procedure Open;

Remarks

Returns immediately. The connection runs on a background thread: OnBeforeConnect fires for every attempt, OnOpen fires when the server accepts the stream and OnEvent fires for every event. If LastEventId has a value, it is sent in the Last-Event-ID header of the first request too.

Example


oSSE.URL := 'https://www.example.com/events';
oSSE.OnOpen := OnSSEOpen;
oSSE.OnEvent := OnSSEEvent;
oSSE.Open;

Back to Methods