C++ Actor Framework 1.0.0
|
Produces text and binary messages for the upper layer. More...
#include <lower_layer.hpp>
Public Member Functions | |
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. | |
Produces text and binary messages for the upper layer.
|
pure virtual |
Returns the buffer for the current binary message.
Must be called between calling begin_binary_message
and end_binary_message
.
|
overridevirtual |
Shuts down any connection or session gracefully.
Any pending data gets flushed before closing the socket.
Implements caf::net::generic_lower_layer.
|
overridevirtual |
Shuts down any connection or session due to an error.
Any pending data gets flushed before closing the socket. Protocols with a dedicated closing handshake such as WebSocket may send the close reason to the peer.
Reimplemented from caf::net::generic_lower_layer.
|
pure virtual |
Returns the buffer for the current text message.
Must be called between calling begin_text_message
and end_text_message
.