|
A11 (C++ runtime)
Native C++ implementation of the A11 action and streaming runtime
|
A WireStream that carries A11 traffic over a WebRTC data channel. More...
#include <cpp/a11/net/webrtc_wire_stream.h>
Public Member Functions | |
| ~WebRtcWireStream () override | |
| std::shared_ptr< rtc::DataChannel > | data_channel () const |
| std::shared_ptr< rtc::PeerConnection > | peer_connection () const |
| std::shared_ptr< SignallingTransport > | signalling_endpoint () const |
| WebRtcWireStream (ConstructorToken, std::shared_ptr< State > state, std::shared_ptr< rtc::DataChannel > data_channel, std::shared_ptr< rtc::PeerConnection > connection, std::shared_ptr< SignallingTransport > signalling_endpoint) | |
Public Member Functions inherited from a11::net::ChannelWireStream | |
| ~ChannelWireStream () override | |
| absl::Status | Send (data::WireMessage message) override |
| Enqueue a message for delivery to the peer. | |
| a11::Task | Start (OnMessage on_message, OnDone on_done) override |
| Begin the stream as the initiating ("start") side. | |
| a11::Task | Accept (OnMessage on_message, OnDone on_done) override |
| Begin the stream as the accepting ("accept") side. | |
| absl::Status | HalfClose (data::ByteMap trailers) override |
| Signal that this side will send no more messages. | |
| a11::Task | DrainOutgoingMessages () override |
| Await delivery of all buffered outbound messages. | |
| absl::Status | Abort (absl::Status status) override |
| Abort the stream, discarding buffered work. | |
| absl::Status | SetDeadline (absl::Time deadline) override |
| Set the absolute deadline after which the stream is aborted. | |
| absl::Time | deadline () const override |
| absl::Status | GetStatus () const override |
| std::optional< data::ByteMap > | GetTrailers () const override |
| std::string | GetId () const override |
| void *absl_nullable | GetImpl () const override |
| absl::Status | HalfClose () |
| Half-close with no trailers. | |
| virtual absl::Status | HalfClose (data::ByteMap trailers)=0 |
| Signal that this side will send no more messages. | |
| absl::Status | SetDeadline () |
| Clear any deadline (equivalent to an infinite deadline). | |
| virtual absl::Status | SetDeadline (absl::Time deadline)=0 |
| Set the absolute deadline after which the stream is aborted. | |
Public Member Functions inherited from a11::net::WireStream | |
| virtual | ~WireStream ()=default |
| absl::Status | HalfClose () |
| Half-close with no trailers. | |
| absl::Status | SetDeadline () |
| Clear any deadline (equivalent to an infinite deadline). | |
Static Public Member Functions | |
| static absl::StatusOr< std::shared_ptr< WebRtcWireStream > > | CreateClient (std::string identity, std::string peer_identity, std::shared_ptr< SignallingService > signalling, WebRtcConfiguration configuration={}, WireStreamOptions options={}) |
| Dials a peer over a shared in-process signalling service. | |
| static absl::StatusOr< std::shared_ptr< WebRtcWireStream > > | CreateClient (std::string peer_identity, std::shared_ptr< SignallingTransport > signalling, WebRtcConfiguration configuration={}, WireStreamOptions options={}) |
| Dials a peer over an explicit signalling transport. | |
| static absl::StatusOr< std::shared_ptr< WebRtcWireStream > > | Create (std::shared_ptr< rtc::DataChannel > data_channel, std::shared_ptr< rtc::PeerConnection > connection, std::shared_ptr< SignallingTransport > signalling_endpoint, ChannelEndpointRole role, WireStreamOptions options={}, OpenOperation open_operation={}, size_t split_size=48 *1024) |
| Adopts an already-established data channel as a WireStream. | |
| static absl::StatusOr< std::shared_ptr< WebRtcWireStream > > | BuildMultiplexedStream (std::shared_ptr< internal::BinaryChannel > channel, std::shared_ptr< rtc::DataChannel > primary_channel, std::shared_ptr< rtc::PeerConnection > connection, std::shared_ptr< SignallingTransport > signalling_endpoint, std::string id, ChannelEndpointRole role, WireStreamOptions options={}, OpenOperation open_operation={}, size_t split_size=48 *1024) |
| Adopts an already-built binary channel (possibly multiplexed). | |
Additional Inherited Members | |
Public Types inherited from a11::net::ChannelWireStream | |
| using | OpenOperation = std::function< absl::Status()> |
| Transport-specific operation that initiates or accepts the channel. | |
Protected Member Functions inherited from a11::net::ChannelWireStream | |
| ChannelWireStream (std::shared_ptr< State > state) | |
Static Protected Member Functions inherited from a11::net::ChannelWireStream | |
| static absl::StatusOr< std::shared_ptr< State > > | MakeState (std::shared_ptr< internal::BinaryChannel > channel, std::string id, ChannelEndpointRole role, OpenOperation open_operation, WireStreamOptions options, ChannelFramingOptions framing={}) |
A WireStream that carries A11 traffic over a WebRTC data channel.
Created by dialing a named peer through a signalling service or transport (CreateClient), or by adopting an already-negotiated libdatachannel channel (Create, used internally by WebRtcWireServer). Framing and fragmentation are handled by the ChannelWireStream base.
|
override |
|
inline |
|
static |
Adopts an already-built binary channel (possibly multiplexed).
Lower-level than Create: the caller owns the channel and its member data channels. primary_channel is retained only for the data_channel() accessor. Used by WebRtcWireServer and the client factory to wrap a multiplexed channel that stripes across several data channels.
|
static |
Adopts an already-established data channel as a WireStream.
The low-level factory used once a peer connection and data channel exist; WebRtcWireServer builds accepted streams through it.
| data_channel | The negotiated libdatachannel data channel. |
| connection | The owning peer connection. |
| signalling_endpoint | Transport the handshake ran over. |
| role | Whether this endpoint is the channel opener or acceptor. |
| options | Transport-level WireStreamOptions. |
| open_operation | Optional operation to await channel open. |
| split_size | Size at which large messages are fragmented. |
|
static |
Dials a peer over a shared in-process signalling service.
| identity | Local identity to register with the service. |
| peer_identity | Identity of the peer to connect to. |
| signalling | In-process signalling service both peers share. |
| configuration | ICE and fragmentation settings. |
| options | Transport-level WireStreamOptions. |
|
static |
Dials a peer over an explicit signalling transport.
Prefer this overload when reaching a peer across a network via a remote signalling server (e.g. a WebSocketSignallingClient) rather than an in-process service.
| peer_identity | Identity of the peer to connect to. |
| signalling | Transport that carries the SDP/ICE handshake. |
| configuration | ICE and fragmentation settings. |
| options | Transport-level WireStreamOptions. |
| std::shared_ptr< rtc::DataChannel > a11::net::WebRtcWireStream::data_channel | ( | ) | const |
| std::shared_ptr< rtc::PeerConnection > a11::net::WebRtcWireStream::peer_connection | ( | ) | const |
| std::shared_ptr< SignallingTransport > a11::net::WebRtcWireStream::signalling_endpoint | ( | ) | const |