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

Accepts incoming WebRTC peer connections under a fixed identity. More...

#include <cpp/a11/net/webrtc_wire_stream.h>

Inheritance diagram for a11::net::WebRtcWireServer:
[legend]

Classes

struct  State
 

Public Member Functions

 ~WebRtcWireServer ()
 
absl::Status Stop ()
 Stops the server and stops accepting new peer connections.
 
std::string identity () const
 
bool running () const
 
size_t pending_peer_count () const
 
std::shared_ptr< SignallingTransport > signalling_endpoint () const
 

Static Public Member Functions

static absl::StatusOr< std::shared_ptr< WebRtcWireServer > > Create (std::string identity, const std::shared_ptr< SignallingService > &signalling, OnWebRtcStream on_stream, WebRtcConfiguration configuration={}, WireStreamOptions stream_options={})
 Creates a WebRTC server that accepts peer connections.
 
static absl::StatusOr< std::shared_ptr< WebRtcWireServer > > Create (const std::shared_ptr< SignallingTransport > &signalling, OnWebRtcStream on_stream, WebRtcConfiguration configuration={}, WireStreamOptions stream_options={})
 Creates a WebRTC server negotiating over an explicit transport.
 

Detailed Description

Accepts incoming WebRTC peer connections under a fixed identity.

Listens on a signalling service for offers addressed to identity, completes the ICE/SDP handshake for each peer, and hands the resulting WebRtcWireStream to a callback.

Constructor & Destructor Documentation

◆ ~WebRtcWireServer()

a11::net::WebRtcWireServer::~WebRtcWireServer ( )

Member Function Documentation

◆ Create() [1/2]

absl::StatusOr< std::shared_ptr< WebRtcWireServer > > a11::net::WebRtcWireServer::Create ( const std::shared_ptr< SignallingTransport > &  signalling,
OnWebRtcStream  on_stream,
WebRtcConfiguration  configuration = {},
WireStreamOptions  stream_options = {} 
)
static

Creates a WebRTC server negotiating over an explicit transport.

Prefer this overload when the peers are reached across a network through a remote signalling server rather than a service in this process: connect a WebSocketSignallingClient to it and hand the client over here. The server listens as whatever identity the transport registered under, so there is no separate identity to keep in step.

The mirror of WebRtcWireStream::CreateClient's transport overload, and the one that makes an agent behind a signalling rendezvous reachable at all.

Parameters
signallingConnected signalling transport; its identity is the server's. The server takes over its message callback, and closes it when stopped. It is the server's rendezvous, not a caller-owned side channel.
on_streamCallback invoked with each accepted stream.
configurationICE and fragmentation settings.
stream_optionsTransport-level WireStreamOptions per stream.
Returns
The running server, or an error status.

◆ Create() [2/2]

absl::StatusOr< std::shared_ptr< WebRtcWireServer > > a11::net::WebRtcWireServer::Create ( std::string  identity,
const std::shared_ptr< SignallingService > &  signalling,
OnWebRtcStream  on_stream,
WebRtcConfiguration  configuration = {},
WireStreamOptions  stream_options = {} 
)
static

Creates a WebRTC server that accepts peer connections.

Registers identity on an in-process signalling service. The overload below is the general one; this is the convenience for the case where the peers are negotiating through a service in this process.

Parameters
identityLocal identity this server listens as.
signallingSignalling service used to negotiate with peers.
on_streamCallback invoked with each accepted stream.
configurationICE and fragmentation settings.
stream_optionsTransport-level WireStreamOptions per stream.
Returns
The running server, or an error status.

◆ identity()

std::string a11::net::WebRtcWireServer::identity ( ) const
Returns
The local identity this server listens as.

◆ pending_peer_count()

size_t a11::net::WebRtcWireServer::pending_peer_count ( ) const
Returns
The number of peers still completing negotiation.

◆ running()

bool a11::net::WebRtcWireServer::running ( ) const
Returns
Whether the server is currently running.

◆ signalling_endpoint()

std::shared_ptr< SignallingTransport > a11::net::WebRtcWireServer::signalling_endpoint ( ) const
Returns
The signalling transport the server negotiates over.

◆ Stop()

absl::Status a11::net::WebRtcWireServer::Stop ( )

Stops the server and stops accepting new peer connections.


The documentation for this class was generated from the following files: