Skip to content

TCustomHTTPEventSource

Base class for Server-Sent Events (SSE) client

Declaration

Source position: fphttpclient.pp line 59

type

  TCustomHTTPEventSource = class(TObject)
  public
    constructor Create;
    destructor Destroy;
    function DataAvailable : Boolean;
    function ReadEvent : Boolean;
    procedure Close;
    property Headers: TStrings; {r}
    property EOF: Boolean; {r}
  end;

Description

TCustomHTTPEventSource provides Server-Sent Events functionality for receiving real-time data streams from HTTP servers. It handles the SSE protocol for parsing event streams and provides methods for reading events and checking data availability.

This class is used internally by the HTTP client for SSE support and can be extended for custom SSE implementations.

Properties

Member Visibility Description
EOF read only public Indicates whether the event stream has ended
Headers read only public HTTP headers from the original Server-Sent Events request
See all Properties

Methods

Member Visibility Description
Close public Closes the event source connection
Create public Creates a new Server-Sent Events source
DataAvailable public Checks if data is available for reading
Destroy public Destroys the Server-Sent Events source
ReadEvent public Reads one Server-Sent Event from the stream
See all Methods

See also

Name Description
THTTPEventSource Default Server-Sent Events source implementation
TFPCustomHTTPClient.GetEventSource Creates a Server-Sent Events connection