| Action Engine
             | 
WebRtcWireStream is a concrete implementation of WireStream that uses WebRTC for communication.
It supports sending and receiving ActionEngine wire messages over a WebRTC data channel. This class is designed to be used in both client and server contexts, allowing for flexible communication patterns.
#include <actionengine/net/webrtc/wire_stream.h>
| Public Member Functions | |
| absl::Status | Send (WireMessage message) override | 
| absl::StatusOr< std::optional< WireMessage > > | Receive (absl::Duration timeout) override | 
| absl::Status | Start () override | 
| absl::Status | Accept () override | 
| void | HalfClose () override | 
| void | Abort () override | 
| absl::Status | GetStatus () const override | 
| std::string | GetId () const override | 
| const void *absl_nullable | GetImpl () const override | 
|  Public Member Functions inherited from act::WireStream | |
| template<typename T> | |
| auto | GetImpl () const -> T * | 
| 
 | overridevirtual | 
Aborts the stream.
This is used to terminate the stream immediately with an "error" state. For example, the result of Receive() following an Abort() call by either side should be an error status, indicating that the stream is no longer usable, and not an empty optional.
Implements act::WireStream.
| 
 | inlineoverridevirtual | 
Accepts the stream on the server side.
Clients should not call this method. It is intended to be called by the server to accept a stream that has been initiated by a client. Implementations that differentiate between client and server streams are allowed to return an error if this method is called on a client, or even to perform a hard termination of the process, as such a call is considered a misuse of the API.
Some implementations may not require this method, in which case they can return an OK status without doing anything.
Implements act::WireStream.
| 
 | inlinenodiscardoverridevirtual | 
Returns the unique (in this process) identifier of the stream.
Implements act::WireStream.
| 
 | inlinenodiscardoverridevirtual | 
Returns the underlying implementation of the stream.
This function is intended to be overridden by derived classes to provide access to the specific implementation of the stream, in case such access is required. The default implementation returns a null pointer.
Reimplemented from act::WireStream.
| 
 | overridevirtual | 
Returns the status of the stream.
This method is used to check the current status of the stream, which is OK unless the stream has been aborted.
absl::Status indicating the current status of the stream. If the stream is in a valid state, it returns absl::OkStatus(). If the stream is in an error state (e.g., due to an abort), it returns an appropriate error status. Implements act::WireStream.
| 
 | inlineoverridevirtual | 
Communicates to the other end that no more messages will be sent over this stream.
Implements act::WireStream.
| 
 | overridevirtual | 
Receives an ActionEngine wire message from the stream.
Blocks to wait for a message to be received, up to the specified timeout.
| timeout | The maximum duration to wait for a message to be received. If the timeout is reached, the function will return an absl::DeadlineExceededError. | 
Receive() is called in a loop, and the loop should be able to terminate gracefully when the stream is aborted. Implements act::WireStream.
| 
 | overridevirtual | 
Sends a WireMessage over the stream.
May or may not block, depending on the implementation. For example, WebsocketWireStream will block until the message is sent, while WebRtcWireStream will return immediately, allowing the message to be sent asynchronously.
With that in mind, the caller should not assume that the message has been sent immediately after this function returns, or even that it has been sent successfully. Failure modes of this method are more about the invariants of the stream itself: for example, if the stream is closed, or half-closed (no more messages can be sent), this method will return an error.
| message | The WireMessage to send, containing action calls (in the form of multiple ActionMessage) and/or node fragments. | 
Implements act::WireStream.
| 
 | inlineoverridevirtual | 
Starts the stream on the client side.
Clients should call this method to initiate the stream after it has been created. This method is intended to be called by the client to start the stream, which may involve some underlying negotiation or setup. Implementations that differentiate between client and server streams are allowed to return an error if this method is called on a server, or even to perform a hard termination of the process, as such a call is considered a misuse of the API.
Some implementations may not require this method, in which case they can return an OK status without doing anything.
Implements act::WireStream.