|
C++ Actor Framework 1.0.0
|
Implements the WebSocket framing protocol as defined in RFC-6455. More...
#include <framing.hpp>
Public Types | |
| using | upper_layer_ptr = std::unique_ptr<web_socket::upper_layer> |
Static Public Member Functions | |
| static std::unique_ptr< framing > | make_client (upper_layer_ptr up) |
| Creates a new framing protocol for client mode. | |
| static std::unique_ptr< framing > | make_server (upper_layer_ptr up) |
| Creates a new framing protocol for server mode. | |
Additional Inherited Members | |
Public Member Functions inherited from caf::net::octet_stream::upper_layer | |
| virtual error | start (lower_layer *down)=0 |
| Initializes the upper layer. | |
| virtual ptrdiff_t | consume (byte_span buffer, byte_span delta)=0 |
| Consumes bytes from the lower layer. | |
| virtual void | written (size_t num_bytes) |
| Called from the lower layer whenever data has been written. | |
Public Member Functions inherited from caf::net::generic_upper_layer | |
| virtual void | prepare_send ()=0 |
| Gives the upper layer an opportunity to add additional data to the output buffer. | |
| virtual bool | done_sending ()=0 |
| Queries whether all pending data has been sent. | |
| virtual void | abort (const error &reason)=0 |
| Called by the lower layer for cleaning up any state in case of an error or when disposed. | |
Public Member Functions inherited from caf::net::web_socket::lower_layer | |
| virtual void | request_messages ()=0 |
Pulls messages from the transport until calling suspend_reading. | |
| virtual void | suspend_reading ()=0 |
Stops reading messages until calling request_messages. | |
| virtual void | begin_binary_message ()=0 |
| Begins transmission of a binary message. | |
| virtual byte_buffer & | binary_message_buffer ()=0 |
| Returns the buffer for the current binary message. | |
| virtual bool | end_binary_message ()=0 |
| Seals the current binary message buffer and ships a new WebSocket frame. | |
| virtual void | begin_text_message ()=0 |
| Begins transmission of a text message. | |
| virtual text_buffer & | text_message_buffer ()=0 |
| Returns the buffer for the current text message. | |
| virtual bool | end_text_message ()=0 |
| Seals the current text message buffer and ships a new WebSocket frame. | |
| void | shutdown () override |
| Shuts down any connection or session gracefully. | |
| void | shutdown (const error &reason) override |
| Shuts down any connection or session due to an error. | |
| virtual void | shutdown (status code, std::string_view msg)=0 |
Sends a shutdown message with custom status code and msg text. | |
Public Member Functions inherited from caf::net::generic_lower_layer | |
| multiplexer & | mpx () noexcept |
| Returns the multiplexer instance that executes this protocol stack. | |
| virtual socket_manager * | manager () noexcept=0 |
| Returns the manager that owns this layer. | |
| virtual bool | can_send_more () const noexcept=0 |
| Queries whether the output device can accept more data straight away. | |
| virtual bool | is_reading () const noexcept=0 |
| Queries whether the lower layer is currently reading from its input device. | |
| virtual void | write_later ()=0 |
| Triggers a write callback after the write device signals downstream capacity. | |
Implements the WebSocket framing protocol as defined in RFC-6455.