C++ Actor Framework 0.19
Loading...
Searching...
No Matches
Public Member Functions | List of all members
caf::net::web_socket::lower_layer Class Referenceabstract

Produces text and binary messages for the upper layer. More...

#include <lower_layer.hpp>

Inheritance diagram for caf::net::web_socket::lower_layer:
caf::net::generic_lower_layer caf::net::web_socket::framing

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_bufferbinary_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 du 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
virtual multiplexermpx () noexcept=0
 Returns the multiplexer instance that executes this protocol stack.
 
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.
 
virtual void shutdown ()=0
 Shuts down any connection or session gracefully.
 
virtual void shutdown (const error &reason)
 Shuts down any connection or session du to an error.
 

Detailed Description

Produces text and binary messages for the upper layer.

Member Function Documentation

◆ begin_binary_message()

virtual void caf::net::web_socket::lower_layer::begin_binary_message ( )
pure virtual

Begins transmission of a binary message.

Implemented in caf::net::web_socket::framing.

◆ begin_text_message()

virtual void caf::net::web_socket::lower_layer::begin_text_message ( )
pure virtual

Begins transmission of a text message.

Implemented in caf::net::web_socket::framing.

◆ binary_message_buffer()

virtual byte_buffer & caf::net::web_socket::lower_layer::binary_message_buffer ( )
pure virtual

Returns the buffer for the current binary message.

Must be called between calling begin_binary_message and end_binary_message.

Implemented in caf::net::web_socket::framing.

◆ end_binary_message()

virtual bool caf::net::web_socket::lower_layer::end_binary_message ( )
pure virtual

Seals the current binary message buffer and ships a new WebSocket frame.

Implemented in caf::net::web_socket::framing.

◆ end_text_message()

virtual bool caf::net::web_socket::lower_layer::end_text_message ( )
pure virtual

Seals the current text message buffer and ships a new WebSocket frame.

Implemented in caf::net::web_socket::framing.

◆ request_messages()

virtual void caf::net::web_socket::lower_layer::request_messages ( )
pure virtual

Pulls messages from the transport until calling suspend_reading.

Implemented in caf::net::web_socket::framing.

◆ shutdown() [1/3]

void caf::net::web_socket::lower_layer::shutdown ( )
overridevirtual

Shuts down any connection or session gracefully.

Any pending data gets flushed before closing the socket.

Implements caf::net::generic_lower_layer.

◆ shutdown() [2/3]

void caf::net::web_socket::lower_layer::shutdown ( const error reason)
overridevirtual

Shuts down any connection or session du 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.

◆ shutdown() [3/3]

virtual void caf::net::web_socket::lower_layer::shutdown ( status  code,
std::string_view  msg 
)
pure virtual

Sends a shutdown message with custom status code and msg text.

Implemented in caf::net::web_socket::framing.

◆ suspend_reading()

virtual void caf::net::web_socket::lower_layer::suspend_reading ( )
pure virtual

Stops reading messages until calling request_messages.

Implemented in caf::net::web_socket::framing.

◆ text_message_buffer()

virtual text_buffer & caf::net::web_socket::lower_layer::text_message_buffer ( )
pure virtual

Returns the buffer for the current text message.

Must be called between calling begin_text_message and end_text_message.

Implemented in caf::net::web_socket::framing.


The documentation for this class was generated from the following file: