|
wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
|
The send/reset operations this layer needs, as a function-pointer table so it never links wired_server_wt_* directly (kept testable without the QUIC/TLS stack). More...
#include <moqtrun.h>
Data Fields | |
| i64(* | open_bidi_stream )(wired_wt_session *s, wired_span payload) |
| wired_server_wt_open_bidi_stream-shaped: opens a stream without FIN, returns the allocated id or negative on failure – the control stream (moqtrun_send_setup) needs this because it stays open for further rounds (SUBSCRIBE_OK/REQUEST_OK/... replies, one per call). | |
| int(* | stream_send )(wired_wt_session *s, u64 stream_id, wired_span payload, int fin) |
| wired_server_wt_stream_send-shaped: appends payload, fin=1 closes. | |
| i64(* | send_uni )(wired_wt_session *s, wired_span payload) |
| wired_server_wt_open_uni-shaped: opens a fresh uni stream, sends the whole payload, and closes it with FIN on the final slice – one call, no keep-open round. | |
| i64(* | open_uni_stream )(wired_wt_session *s, wired_span payload) |
| wired_server_wt_open_uni_stream-shaped: opens a fresh uni stream WITHOUT FIN, sends payload as its first round, and keeps the stream open for further stream_send rounds – used to start a subscriber's long-lived relay stream (the audio track's per-frame relay, unlike chat's one-shot send_uni). | |
| int(* | stream_fin )(wired_wt_session *s, u64 stream_id) |
| wired_server_wt_stream_fin-shaped: ends a stream opened via open_uni_stream/stream_send(fin=0) with no further bytes – used when the publisher's own stream FIN arrives on a call carrying no new Object bytes of its own (moqtrun_relay_append_one's own doc: a WebTransport writer's close() can land as its own byte-less call, separate from the data written just before it, so this table's callers cannot always fold the FIN into stream_send's non-empty- payload contract). | |
| int(* | stream_reset )(wired_wt_session *s, u64 stream_id, u32 error_code) |
| wired_server_wt_stream_reset-shaped: abandons a stream opened via open_uni_stream (RESET_STREAM to the peer, pending bytes dropped) – used to shed a subscriber's stale relay backlog after sustained busy refusals (WIRED_MOQTRUN_RESET_AFTER_BUSY). | |
| i64(* | send_uni2 )(wired_wt_session *s, wired_span head, wired_span body) |
| wired_server_wt_open_uni-shaped for a two-part payload: head (a short framing prefix) immediately followed by body (a large media fragment the hub holds only as a view into caller storage). | |
| int(* | send_datagram )(wired_wt_session *s, wired_span payload) |
| wired_server_wt_send_datagram_to-shaped: queues one QUIC DATAGRAM to s's peer (the adapter owns any session prefixing, RFC 9297 2.1; the payload is copied at queue time). | |
| int(* | stream_hold )(wired_wt_session *s, u64 stream_id, int hold) |
| wired_server_wt_stream_hold-shaped: hold=1 stops raising the publisher's receive credit on stream_id, hold=0 resumes it. | |
| usz(* | send_budget )(wired_wt_session *s) |
| Remaining session-level send credit for s in bytes (the peer's WT_MAX_DATA minus bytes already staged), (usz)-1 for a session without a limit. | |
| int(* | close_session )(wired_wt_session *s, u32 error_code, wired_span reason) |
| wired_server_wt_close_session-shaped: closes s (WT_CLOSE_SESSION on WebTransport, CONNECTION_CLOSE on raw QUIC) with a MoQT session termination code (draft-ietf-moq-transport-19 SS3.5, -22 6.6) and reason; the hub only ever passes WIRED_MOQTRUN_CLOSE_* codes. | |
| int(* | stream_reply_open )(wired_wt_session *s, u64 stream_id, wired_span payload) |
| wired_server_wt_stream_reply_open-shaped: the first reply round on a peer-opened request stream (draft-ietf-moq-transport-19 3.3), kept open for later stream_send rounds. | |
| int(* | stream_priority )(wired_wt_session *s, u64 stream_id, u8 urgency) |
| wired_server_wt_stream_priority-shaped: sets the RFC 9218 urgency (0..7, lower first) of a subscriber stream the hub just opened – the subscription's priorities mapped by WIRED_MOQTRUN_URGENCY. | |
| int(* | stream_stop )(wired_wt_session *s, u64 stream_id, u32 error_code) |
| wired_server_wt_stream_stop-shaped: asks the peer to stop sending on a PEER-initiated stream (one STOP_SENDING carrying error_code) – the receive-side counterpart of stream_reset, used for an inbound data stream the hub cannot route. | |
| u64(* | est_kbps )(wired_wt_session *s) |
| wired_server_wt_est_kbps-shaped: the session's delivery-rate estimate in kbps, 0 when unknown – the SSTS default split's budget (the stricter of it and wired_moqt_hub.ssts_cap_kbps). | |
| int(* | stream_sched )(wired_wt_session *s, u64 stream_id, const wired_wt_sched *k) |
| wired_server_wt_stream_schedule-shaped: sets the full send class of an Object stream the hub just opened (draft-ietf-moq-transport-22 7.2): urgency 4, fine Subscriber Priority << 8 | Publisher Priority, flow the subscription (a FETCH its own), order the Group ID (~Group ID when Descending), tie fill-before-live then Subgroup ID. | |
The send/reset operations this layer needs, as a function-pointer table so it never links wired_server_wt_* directly (kept testable without the QUIC/TLS stack).
The table is transport-neutral: the backend decides the wire form, e.g. wired_moqraw_io (app/moqt/qraw/moqrawio.h) prefixes the WebTransport stream signal only for WT sessions and closes a raw-QUIC session with CONNECTION_CLOSE. A test harness fills it with recording stubs.
| int(* wired_moqt_io::close_session) (wired_wt_session *s, u32 error_code, wired_span reason) |
wired_server_wt_close_session-shaped: closes s (WT_CLOSE_SESSION on WebTransport, CONNECTION_CLOSE on raw QUIC) with a MoQT session termination code (draft-ietf-moq-transport-19 SS3.5, -22 6.6) and reason; the hub only ever passes WIRED_MOQTRUN_CLOSE_* codes.
Kept last so older positional initializers stay valid; a table built without it (0) never closes a session – a control message that requires a close is skipped by its Length instead.
| u64(* wired_moqt_io::est_kbps) (wired_wt_session *s) |
wired_server_wt_est_kbps-shaped: the session's delivery-rate estimate in kbps, 0 when unknown – the SSTS default split's budget (the stricter of it and wired_moqt_hub.ssts_cap_kbps).
Kept last so older positional initializers stay valid; a table built without it (0) leaves the budget to the cap alone.
| usz(* wired_moqt_io::send_budget) (wired_wt_session *s) |
Remaining session-level send credit for s in bytes (the peer's WT_MAX_DATA minus bytes already staged), (usz)-1 for a session without a limit.
Kept last so older positional initializers stay valid; a table built without it (0) reports no limit, so the reliable relay drains as fast as its per-round refusals allow – the pre- send_budget behavior, unchanged.
| int(* wired_moqt_io::send_datagram) (wired_wt_session *s, wired_span payload) |
wired_server_wt_send_datagram_to-shaped: queues one QUIC DATAGRAM to s's peer (the adapter owns any session prefixing, RFC 9297 2.1; the payload is copied at queue time).
Returns 1 queued, 0 refused (no live connection, ring full, or oversized). Kept LAST so older positional initializers of this table stay valid; a table built without it (0) simply has no datagram plane – wired_moqt_on_datagram then relays nothing (and never dereferences the null pointer).
| i64(* wired_moqt_io::send_uni) (wired_wt_session *s, wired_span payload) |
wired_server_wt_open_uni-shaped: opens a fresh uni stream, sends the whole payload, and closes it with FIN on the final slice – one call, no keep-open round.
Used for a relayed Object (one complete SUBGROUP_HEADER+Object per stream), which never needs a second round.
| i64(* wired_moqt_io::send_uni2) (wired_wt_session *s, wired_span head, wired_span body) |
wired_server_wt_open_uni-shaped for a two-part payload: head (a short framing prefix) immediately followed by body (a large media fragment the hub holds only as a view into caller storage).
The adapter concatenates them (with its own signal prefix) into session-owned staging; -1 when it has none free. Returns the stream id or negative.
| int(* wired_moqt_io::stream_hold) (wired_wt_session *s, u64 stream_id, int hold) |
wired_server_wt_stream_hold-shaped: hold=1 stops raising the publisher's receive credit on stream_id, hold=0 resumes it.
Kept last so older positional initializers stay valid; a table built without it (0) has no backpressure plane, so the reliable relay is never engaged (a ring that cannot hold its publisher would only overflow).
| int(* wired_moqt_io::stream_priority) (wired_wt_session *s, u64 stream_id, u8 urgency) |
wired_server_wt_stream_priority-shaped: sets the RFC 9218 urgency (0..7, lower first) of a subscriber stream the hub just opened – the subscription's priorities mapped by WIRED_MOQTRUN_URGENCY.
Kept last so older positional initializers stay valid; a table built without it (0) leaves every stream at the transport's default urgency.
| int(* wired_moqt_io::stream_reply_open) (wired_wt_session *s, u64 stream_id, wired_span payload) |
wired_server_wt_stream_reply_open-shaped: the first reply round on a peer-opened request stream (draft-ietf-moq-transport-19 3.3), kept open for later stream_send rounds.
Returns 1 accepted, 0 on failure. Kept last so older positional initializers stay valid; a table built without it (0) has no request streams – a peer-opened bidi stream is left to the data path, which drops it.
| int(* wired_moqt_io::stream_reset) (wired_wt_session *s, u64 stream_id, u32 error_code) |
wired_server_wt_stream_reset-shaped: abandons a stream opened via open_uni_stream (RESET_STREAM to the peer, pending bytes dropped) – used to shed a subscriber's stale relay backlog after sustained busy refusals (WIRED_MOQTRUN_RESET_AFTER_BUSY).
Returns 1 when the reset is queued, 0 when it could not be (the caller retries next round).
| int(* wired_moqt_io::stream_sched) (wired_wt_session *s, u64 stream_id, const wired_wt_sched *k) |
wired_server_wt_stream_schedule-shaped: sets the full send class of an Object stream the hub just opened (draft-ietf-moq-transport-22 7.2): urgency 4, fine Subscriber Priority << 8 | Publisher Priority, flow the subscription (a FETCH its own), order the Group ID (~Group ID when Descending), tie fill-before-live then Subgroup ID.
Used instead of stream_priority when set. Kept last so older positional initializers stay valid; a table built without it (0) falls back to stream_priority.
| int(* wired_moqt_io::stream_send) (wired_wt_session *s, u64 stream_id, wired_span payload, int fin) |
wired_server_wt_stream_send-shaped: appends payload, fin=1 closes.
wired_server_wt_stream_send never accepts an empty payload (a FIN needs a final non-empty slice to ride on – see its doc), so this table's callers never invoke stream_send with fin=1 and an empty payload; use send_uni for a stream that closes with its only round.
| int(* wired_moqt_io::stream_stop) (wired_wt_session *s, u64 stream_id, u32 error_code) |
wired_server_wt_stream_stop-shaped: asks the peer to stop sending on a PEER-initiated stream (one STOP_SENDING carrying error_code) – the receive-side counterpart of stream_reset, used for an inbound data stream the hub cannot route.
Kept last so older positional initializers stay valid; a table built without it (0) leaves the unwanted stream to drain unread.