An in-process broker that routes signalling messages by identity.
More...
#include <cpp/a11/net/signalling.h>
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.
◆ ~SignallingService()
| a11::net::SignallingService::~SignallingService |
( |
| ) |
|
◆ Connect()
Registers an identity and its inbound-message callback.
- Parameters
-
| identity | Identity other peers address messages to. |
| on_message | Async 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()
- Returns
- A new, empty in-process signalling service.
◆ Deliver()
Delivers a message to a locally connected recipient.
The ingress half of a federated signalling fabric: Route() carries a message from an endpoint this service holds, and Deliver() carries one that arrived from somewhere else – another process, another host – and needs placing into the recipient's queue as though it had. Paired with WebSocketSignallingServerOptions::on_unroutable, which is the egress half, it lets several servers behave as one without either of them knowing how the messages travel between them.
The message's sender is taken as given, because the caller is the only party that knows whether it was authenticated. A transport handing this untrusted input must set sender itself.
- Parameters
-
| message | The message to deliver; its recipient selects the target. |
- Returns
- OK,
NOT_FOUND when the recipient is not connected here, or the recipient's terminal status when it is disconnecting.
◆ 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.
◆ SignallingEndpoint
The documentation for this class was generated from the following files: