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

An in-process broker that routes signalling messages by identity. More...

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

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

Classes

struct  State
 

Public Member Functions

 ~SignallingService ()
 
absl::StatusOr< std::shared_ptr< SignallingEndpoint > > Connect (std::string identity, OnSignallingMessage on_message)
 Registers an identity and its inbound-message callback.
 
bool Contains (std::string_view identity) const
 
std::vector< std::string > Identities () const
 
absl::Status Stop ()
 Stops the service and disconnects all endpoints.
 

Static Public Member Functions

static std::shared_ptr< SignallingServiceCreate ()
 

Friends

class SignallingEndpoint
 

Detailed Description

An in-process broker that routes signalling messages by identity.

Each peer registers an identity and inbound callback via Connect(); a message's recipient field selects the endpoint it is delivered to. Used to bootstrap WebRTC peers in the same process, and fronted by WebSocketSignallingServer when peers are remote.

Constructor & Destructor Documentation

◆ ~SignallingService()

a11::net::SignallingService::~SignallingService ( )

Member Function Documentation

◆ Connect()

absl::StatusOr< std::shared_ptr< SignallingEndpoint > > a11::net::SignallingService::Connect ( std::string  identity,
OnSignallingMessage  on_message 
)

Registers an identity and its inbound-message callback.

Parameters
identityIdentity other peers address messages to.
on_messageAsync callback invoked for each inbound message.
Returns
The connected endpoint, or an error status.

◆ Contains()

bool a11::net::SignallingService::Contains ( std::string_view  identity) const
Returns
Whether the given identity is currently connected.

◆ Create()

std::shared_ptr< SignallingService > a11::net::SignallingService::Create ( )
static
Returns
A new, empty in-process signalling service.

◆ Identities()

std::vector< std::string > a11::net::SignallingService::Identities ( ) const
Returns
The list of currently connected identities.

◆ Stop()

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

Stops the service and disconnects all endpoints.

Friends And Related Symbol Documentation

◆ SignallingEndpoint


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