struct SseClient {
int fd;
?&heap TlsStream tls;
int chunked;
unsigned long chunk_left;
int eof;
struct SseParser parser;
struct String raw;
}Fields
the TLS session for https://, else null
the response used chunked transfer coding
undecoded bytes when chunked
Methods
§
static struct SseClient connect(
const &char url,
const ?&char last_event_id,
int timeout_ms,
?&int ok,
)source · definitionGETs 'url' (http:// or https://) with Accept: text/event-stream and checks for a 200 text/event-stream response. 'last_event_id' (or null) is sent as Last-Event-ID. *ok = 0 on any failure. connect_tls takes https:// settings ('cfg' null: TlsConfig::new()'s defaults).
§
static struct SseClient connect_tls(
const &char url,
const ?&char last_event_id,
const ?&TlsConfig cfg,
int timeout_ms,
?&int ok,
)source · definitionBlocks for the next event: 1 with 'out' filled, 0 once the stream ended or failed.
= drop()