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

A SignallingTransport that relays messages over a WebSocket. More...

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

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

Classes

struct  State
 

Public Member Functions

 ~WebSocketSignallingClient () override
 
absl::Status Send (SignallingMessage message) override
 Sends a signalling message to the peer (non-blocking).
 
absl::Status SetOnMessage (OnSignallingMessage on_message) override
 Registers the async callback invoked for each inbound message.
 
absl::Status Close () override
 Closes the transport and releases its resources.
 
std::string identity () const override
 
bool connected () const override
 
absl::Status GetStatus () const override
 
void *absl_nullable GetImpl () const
 
 WebSocketSignallingClient (ConstructorToken, std::shared_ptr< State > state)
 
- Public Member Functions inherited from a11::net::SignallingTransport
virtual ~SignallingTransport ()=default
 

Static Public Member Functions

static a11::Future< std::shared_ptr< WebSocketSignallingClient > > Connect (std::string url, std::string identity, OnSignallingMessage on_message={}, WebSocketSignallingClientOptions options={})
 Asynchronously connects to a WebSocket signalling server.
 

Detailed Description

A SignallingTransport that relays messages over a WebSocket.

The client a remote WebRTC peer uses to reach a WebSocketSignallingServer: it registers under an identity and carries SignallingMessage traffic to and from the fronted SignallingService. Pass it to WebRtcWireStream::CreateClient as the signalling transport.

Constructor & Destructor Documentation

◆ ~WebSocketSignallingClient()

a11::net::WebSocketSignallingClient::~WebSocketSignallingClient ( )
override

◆ WebSocketSignallingClient()

a11::net::WebSocketSignallingClient::WebSocketSignallingClient ( ConstructorToken  ,
std::shared_ptr< State state 
)
inlineexplicit

Member Function Documentation

◆ Close()

absl::Status a11::net::WebSocketSignallingClient::Close ( )
overridevirtual

Closes the transport and releases its resources.

Implements a11::net::SignallingTransport.

◆ Connect()

a11::Future< std::shared_ptr< WebSocketSignallingClient > > a11::net::WebSocketSignallingClient::Connect ( std::string  url,
std::string  identity,
OnSignallingMessage  on_message = {},
WebSocketSignallingClientOptions  options = {} 
)
static

Asynchronously connects to a WebSocket signalling server.

Parameters
urlThe ws:// or wss:// signalling server URL.
identityIdentity to register under.
on_messageOptional callback for inbound signalling messages.
optionsTransport tuning and deadline.
Returns
An awaitable resolving to the connected client once registered.

◆ connected()

bool a11::net::WebSocketSignallingClient::connected ( ) const
overridevirtual
Returns
Whether the transport is currently connected.

Implements a11::net::SignallingTransport.

◆ GetImpl()

void *absl_nullable a11::net::WebSocketSignallingClient::GetImpl ( ) const
Returns
An opaque native handle for advanced interop, or nullptr.

◆ GetStatus()

absl::Status a11::net::WebSocketSignallingClient::GetStatus ( ) const
overridevirtual
Returns
The current transport status.

Implements a11::net::SignallingTransport.

◆ identity()

std::string a11::net::WebSocketSignallingClient::identity ( ) const
overridevirtual
Returns
The local identity bound to this transport.

Implements a11::net::SignallingTransport.

◆ Send()

absl::Status a11::net::WebSocketSignallingClient::Send ( SignallingMessage  message)
overridevirtual

Sends a signalling message to the peer (non-blocking).

Implements a11::net::SignallingTransport.

◆ SetOnMessage()

absl::Status a11::net::WebSocketSignallingClient::SetOnMessage ( OnSignallingMessage  on_message)
overridevirtual

Registers the async callback invoked for each inbound message.

Implements a11::net::SignallingTransport.


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