C++ Actor Framework 0.19
|
Configures a WebSocket server or client to operate on the granularity of regular WebSocket frames. More...
#include <default_trait.hpp>
Public Types | |
using | input_type = frame |
The input type of the application, i.e., what that flows from the WebSocket to the application layer. | |
using | output_type = frame |
The output type of the application, i.e., what flows from the application layer to the WebSocket. | |
using | input_resource = async::consumer_resource< input_type > |
A resource for consuming input_type elements. | |
using | output_resource = async::producer_resource< output_type > |
A resource for producing output_type elements. | |
template<class... Ts> | |
using | accept_event = cow_tuple< input_resource, output_resource, Ts... > |
An accept event from the server to transmit read and write handles. | |
template<class... Ts> | |
using | acceptor_resource = async::consumer_resource< accept_event< Ts... > > |
A resource for consuming accept events. | |
Public Member Functions | |
bool | converts_to_binary (const output_type &x) |
Queries whether x should be serialized as binary frame (true ) or text frame (false ). | |
bool | convert (const output_type &x, byte_buffer &bytes) |
Serializes an output to raw bytes for sending a binary frame (converts_to_binary returned true ). | |
bool | convert (const output_type &x, std::vector< char > &text) |
Serializes an output to ASCII (or UTF-8) characters for sending a text frame (converts_to_binary returned false ). | |
bool | convert (const_byte_span bytes, input_type &x) |
Converts the raw bytes from a binary frame to the input type. | |
bool | convert (std::string_view text, input_type &x) |
Converts the characters from a text frame to the input type. | |
error | last_error () |
Returns a description of the error if any of the convert functions returned false . | |
Configures a WebSocket server or client to operate on the granularity of regular WebSocket frames.