A11 (C++ runtime)
Native C++ implementation of the A11 action and streaming runtime
Loading...
Searching...
No Matches
a11::net Namespace Reference

Namespaces

namespace  internal
 

Classes

struct  ByteChunkingOptions
 Bounds packet size and incomplete-message memory during reassembly. More...
 
struct  BytePacket
 Parsed packet metadata plus the owned piece of application payload. More...
 
class  ByteReassembler
 Bounded, thread-safe reassembly for interleaved binary messages. More...
 
struct  ChannelFramingOptions
 Packetisation and incomplete-message bounds for a binary WireStream. More...
 
class  ChannelWireStream
 Shared WireStream lifecycle and framing for binary channels. More...
 
class  Http2Client
 An HTTP/2 client connection, reusable across many streams. More...
 
class  Http2Connection
 
class  Http2DuplexStream
 Client side of an HTTP/2 extended CONNECT stream. More...
 
struct  Http2Options
 Body-size limits, buffering thresholds, deadline, and TLS for an HTTP/2 client or server. More...
 
class  Http2RequestBodyStream
 Pull-oriented request DATA for an extended CONNECT stream. More...
 
class  Http2ResponseStream
 A pull-oriented HTTP/2 response body stream. More...
 
class  Http2ResponseWriter
 Server-side handle for writing an HTTP/2 response to one request. More...
 
class  Http2Server
 An HTTP/2 server that dispatches each request to an async handler. More...
 
struct  Http2TlsOptions
 TLS settings for an HTTP/2 client or server (certificates, peer verification). More...
 
struct  HttpRequest
 A parsed HTTP/2 request: pseudo-headers, fields, and body. More...
 
struct  HttpResponse
 A fully buffered HTTP/2 response: head plus complete body. More...
 
struct  HttpResponseHead
 Status line and headers of an HTTP/2 response, without the body. More...
 
class  HttpSseClientWireStream
 The client-side HTTP SSE wire stream, dialing out to a server URL. More...
 
struct  HttpSseOptions
 Endpoint paths and transport tuning for an HTTP SSE wire stream. More...
 
class  HttpSseServer
 Hosts HTTP SSE wire streams on top of an HTTP/2 server. More...
 
class  HttpSseServerWireStream
 The server-side HTTP SSE wire stream, accepted from a client. More...
 
class  HttpSseWireStream
 Common base for the client and server HTTP SSE wire streams. More...
 
class  InProcessWireStream
 A WireStream endpoint wired directly to a peer in the same process. More...
 
class  SignallingEndpoint
 An identity-bound endpoint into an in-process SignallingService. More...
 
struct  SignallingMessage
 One signalling payload: an SDP description, an ICE candidate, or an error. More...
 
class  SignallingService
 An in-process broker that routes signalling messages by identity. More...
 
class  SignallingTransport
 Abstract identity-bound channel over which signalling flows. More...
 
struct  TurnServer
 Address and credentials for a TURN relay used during ICE. More...
 
struct  WebRtcConfiguration
 ICE, fragmentation, and binding settings for a WebRTC connection. More...
 
class  WebRtcWireServer
 Accepts incoming WebRTC peer connections under a fixed identity. More...
 
class  WebRtcWireStream
 A WireStream that carries A11 traffic over a WebRTC data channel. More...
 
struct  WebSocketClientOptions
 Client-side tuning for a WebSocketWireStream connection. More...
 
struct  WebSocketServerOptions
 Listen address, path, and per-stream defaults for a WebSocketWireServer. More...
 
class  WebSocketSignallingClient
 A SignallingTransport that relays messages over a WebSocket. More...
 
struct  WebSocketSignallingClientOptions
 Connection tuning for a WebSocketSignallingClient. More...
 
class  WebSocketSignallingServer
 Fronts an in-process SignallingService over a WebSocket. More...
 
struct  WebSocketSignallingServerOptions
 Listen address and limits for a WebSocketSignallingServer. More...
 
class  WebSocketWireServer
 Accepts inbound WebSocket connections and hands each to a callback. More...
 
class  WebSocketWireStream
 A WireStream that carries A11 traffic over a client or accepted WebSocket. More...
 
class  WireStream
 A bidirectional, message-oriented channel between two A11 endpoints. More...
 
struct  WireStreamOptions
 Buffering, sizing, and deadline limits for a WireStream endpoint. More...
 
class  WireStreamWithRecv
 Pull-oriented adapter for a callback-driven WireStream. More...
 

Typedefs

using HttpHeaders = std::vector< std::pair< std::string, std::string > >
 An ordered list of (name, value) HTTP/2 header fields.
 
using Http2RequestHandler = std::function< a11::Task(HttpRequest request, std::shared_ptr< Http2ResponseWriter > response)>
 Callback dispatched for each inbound request, given a response writer.
 
using OnHttpSseConnect = std::function< a11::Task(std::shared_ptr< HttpSseServerWireStream >)>
 Callback invoked with each accepted server-side SSE wire stream.
 
using HttpSseWireStreamServer = HttpSseServer
 Alias for HttpSseServer, spelled to match the WireStream naming family.
 
using OnSignallingMessage = std::function< a11::Task(SignallingMessage message)>
 Async callback invoked for each inbound SignallingMessage.
 
using OnWebRtcStream = std::function< a11::Task(std::shared_ptr< WebRtcWireStream >)>
 Callback invoked with each newly negotiated peer WireStream.
 
using OnWebSocketStream = std::function< a11::Task(std::shared_ptr< WebSocketWireStream >)>
 Callback invoked with a fresh WireStream for each accepted connection.
 
using OnMessage = std::function< a11::Task(std::optional< data::WireMessage > message)>
 Called for each inbound message; std::nullopt signals the peer half-closed.
 
using OnDone = std::function< a11::Task()>
 Called once, when the stream has fully finished (cleanly or via abort).
 

Enumerations

enum class  BytePacketType : std::uint8_t { kCompleteBytes = 0x00 , kByteChunk = 0x01 , kLengthSuffixedByteChunk = 0x02 }
 Packet shapes in the Action Engine byte-chunking wire format. More...
 
enum class  ChannelEndpointRole { kClient , kServer , kEither }
 Handshake role a binary channel endpoint is permitted to assume. More...
 
enum class  SignallingMessageType { kDescription , kCandidate , kError }
 The kind of payload a SignallingMessage carries. More...
 
enum class  TurnRelayType { kUdp , kTcp , kTls }
 Transport used to reach a TURN relay server. More...
 

Functions

absl::StatusOr< std::vector< std::string > > SplitBytesIntoPackets (std::string_view bytes, std::uint64_t transient_id, size_t packet_size)
 Split bytes into Action Engine packets with fixed little-endian suffixes.
 
absl::StatusOr< BytePacketParseBytePacket (std::string_view packet)
 Parse and validate one packet without retaining the input view.
 
void NormalizeHttpHeaders (HttpHeaders *headers)
 
std::optional< std::string > GetHttpHeader (const HttpHeaders &headers, std::string_view name)
 
void EraseHttpHeader (HttpHeaders *headers, std::string_view name)
 
void SetHttpHeader (HttpHeaders *headers, std::string name, std::string value)
 
absl::Status ValidateHttpHeaders (const HttpHeaders &headers)
 
void NormalizeHttpHeaders (HttpHeaders *absl_nonnull headers)
 Lowercases every field name in headers in place.
 
void EraseHttpHeader (HttpHeaders *absl_nonnull headers, std::string_view name)
 Removes every field named name from headers.
 
void SetHttpHeader (HttpHeaders *absl_nonnull headers, std::string name, std::string value)
 Replaces any existing name fields with a single (name, value) entry.
 
absl::StatusOr< rtc::Configuration > BuildLibDataChannelConfiguration (const WebRtcConfiguration &configuration)
 
absl::StatusOr< data::ByteMapNormalizeWireHeaders (data::ByteMap headers)
 Validate and case-normalise a wire header map, returning the normalised copy or a non-OK status if a header name/value is invalid.
 

Variables

constexpr std::string_view kSseStreamIdHeader = "x-a11-stream-id"
 Response header naming the stream id assigned to an SSE connection.
 
constexpr std::string_view kSseHttpHeaderPrefix = "x-a11-http-"
 Prefix under which application HTTP headers are tunneled over SSE.
 
constexpr std::string_view kDefaultSseConnectEndpoint = "/connect"
 Default path on which a client opens the SSE event stream.
 
constexpr std::string_view kDefaultSseMessageEndpoint
 Default message-post path template ({id} is the stream id).
 
constexpr std::string_view kAbortStatusHeader = "x-a11-abort-status"
 Trailer key under which an aborting endpoint reports its terminal status.
 
constexpr size_t kMaxSingleMessageSize = 32 * 1024 * 1024
 Hard ceiling on the size of a single reassembled inbound WireMessage.
 

Typedef Documentation

◆ Http2RequestHandler

using a11::net::Http2RequestHandler = typedef std::function<a11::Task( HttpRequest request, std::shared_ptr<Http2ResponseWriter> response)>

Callback dispatched for each inbound request, given a response writer.

◆ HttpHeaders

using a11::net::HttpHeaders = typedef std::vector<std::pair<std::string, std::string> >

An ordered list of (name, value) HTTP/2 header fields.

Field names are normalized to lowercase. A compact sequence preserves repeated fields and wire order without allocating a tree node per field.

◆ HttpSseWireStreamServer

Alias for HttpSseServer, spelled to match the WireStream naming family.

◆ OnDone

Called once, when the stream has fully finished (cleanly or via abort).

◆ OnHttpSseConnect

Callback invoked with each accepted server-side SSE wire stream.

◆ OnMessage

using a11::net::OnMessage = typedef std::function<a11::Task(std::optional<data::WireMessage> message)>

Called for each inbound message; std::nullopt signals the peer half-closed.

Returns an awaitable the transport awaits before delivering the next message (this is where a consumer applies backpressure).

◆ OnSignallingMessage

Async callback invoked for each inbound SignallingMessage.

◆ OnWebRtcStream

using a11::net::OnWebRtcStream = typedef std::function<a11::Task(std::shared_ptr<WebRtcWireStream>)>

Callback invoked with each newly negotiated peer WireStream.

◆ OnWebSocketStream

Callback invoked with a fresh WireStream for each accepted connection.

Enumeration Type Documentation

◆ BytePacketType

enum class a11::net::BytePacketType : std::uint8_t
strong

Packet shapes in the Action Engine byte-chunking wire format.

Enumerator
kCompleteBytes 
kByteChunk 
kLengthSuffixedByteChunk 

◆ ChannelEndpointRole

Handshake role a binary channel endpoint is permitted to assume.

Enumerator
kClient 
kServer 
kEither 

◆ SignallingMessageType

The kind of payload a SignallingMessage carries.

Enumerator
kDescription 
kCandidate 
kError 

◆ TurnRelayType

Transport used to reach a TURN relay server.

Enumerator
kUdp 
kTcp 
kTls 

Function Documentation

◆ BuildLibDataChannelConfiguration()

absl::StatusOr< rtc::Configuration > a11::net::BuildLibDataChannelConfiguration ( const WebRtcConfiguration configuration)

◆ EraseHttpHeader() [1/2]

void a11::net::EraseHttpHeader ( HttpHeaders *absl_nonnull  headers,
std::string_view  name 
)

Removes every field named name from headers.

◆ EraseHttpHeader() [2/2]

void a11::net::EraseHttpHeader ( HttpHeaders headers,
std::string_view  name 
)

◆ GetHttpHeader()

std::optional< std::string > a11::net::GetHttpHeader ( const HttpHeaders headers,
std::string_view  name 
)
Returns
The first value for name, or nullopt if absent.

◆ NormalizeHttpHeaders() [1/2]

void a11::net::NormalizeHttpHeaders ( HttpHeaders *absl_nonnull  headers)

Lowercases every field name in headers in place.

◆ NormalizeHttpHeaders() [2/2]

void a11::net::NormalizeHttpHeaders ( HttpHeaders headers)

◆ NormalizeWireHeaders()

absl::StatusOr< data::ByteMap > a11::net::NormalizeWireHeaders ( data::ByteMap  headers)

Validate and case-normalise a wire header map, returning the normalised copy or a non-OK status if a header name/value is invalid.

◆ ParseBytePacket()

absl::StatusOr< BytePacket > a11::net::ParseBytePacket ( std::string_view  packet)

Parse and validate one packet without retaining the input view.

◆ SetHttpHeader() [1/2]

void a11::net::SetHttpHeader ( HttpHeaders *absl_nonnull  headers,
std::string  name,
std::string  value 
)

Replaces any existing name fields with a single (name, value) entry.

◆ SetHttpHeader() [2/2]

void a11::net::SetHttpHeader ( HttpHeaders headers,
std::string  name,
std::string  value 
)

◆ SplitBytesIntoPackets()

absl::StatusOr< std::vector< std::string > > a11::net::SplitBytesIntoPackets ( std::string_view  bytes,
std::uint64_t  transient_id,
size_t  packet_size 
)

Split bytes into Action Engine packets with fixed little-endian suffixes.

◆ ValidateHttpHeaders()

absl::Status a11::net::ValidateHttpHeaders ( const HttpHeaders headers)
Returns
OK if the header list is well-formed.

Variable Documentation

◆ kAbortStatusHeader

constexpr std::string_view a11::net::kAbortStatusHeader = "x-a11-abort-status"
inlineconstexpr

Trailer key under which an aborting endpoint reports its terminal status.

◆ kDefaultSseConnectEndpoint

constexpr std::string_view a11::net::kDefaultSseConnectEndpoint = "/connect"
inlineconstexpr

Default path on which a client opens the SSE event stream.

◆ kDefaultSseMessageEndpoint

constexpr std::string_view a11::net::kDefaultSseMessageEndpoint
inlineconstexpr
Initial value:
=
"/streams/{id}/message"

Default message-post path template ({id} is the stream id).

◆ kMaxSingleMessageSize

constexpr size_t a11::net::kMaxSingleMessageSize = 32 * 1024 * 1024
inlineconstexpr

Hard ceiling on the size of a single reassembled inbound WireMessage.

◆ kSseHttpHeaderPrefix

constexpr std::string_view a11::net::kSseHttpHeaderPrefix = "x-a11-http-"
inlineconstexpr

Prefix under which application HTTP headers are tunneled over SSE.

◆ kSseStreamIdHeader

constexpr std::string_view a11::net::kSseStreamIdHeader = "x-a11-stream-id"
inlineconstexpr

Response header naming the stream id assigned to an SSE connection.