C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
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 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
multiplexermpx () noexcept
 Returns the multiplexer instance that executes this protocol stack.
 
virtual socket_managermanager () 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.
 

Detailed Description

Produces text and binary messages for the upper layer.

Member Function Documentation

◆ 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.

◆ shutdown() [1/2]

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/2]

void caf::net::web_socket::lower_layer::shutdown ( const error & reason)
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.

◆ 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.


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