C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::net::lp::lower_layer Class Referenceabstract

Provides access to a resource that operates on the granularity of binary messages. More...

#include <lower_layer.hpp>

Inheritance diagram for caf::net::lp::lower_layer:
caf::net::generic_lower_layer caf::net::lp::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_message ()=0
 Prepares the layer for an outgoing message, e.g., by allocating an output buffer as necessary.
 
virtual byte_buffermessage_buffer ()=0
 Returns a reference to the buffer for assembling the current message.
 
virtual bool end_message ()=0
 Seals and prepares a message for transfer.
 
- 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.
 
virtual void shutdown ()=0
 Shuts down any connection or session gracefully.
 
virtual void shutdown (const error &reason)
 Shuts down any connection or session due to an error.
 

Detailed Description

Provides access to a resource that operates on the granularity of binary messages.

Member Function Documentation

◆ end_message()

virtual bool caf::net::lp::lower_layer::end_message ( )
pure virtual

Seals and prepares a message for transfer.

Note
When returning false, clients must also call down.set_read_error(...) with an appropriate error code.

◆ message_buffer()

virtual byte_buffer & caf::net::lp::lower_layer::message_buffer ( )
pure virtual

Returns a reference to the buffer for assembling the current message.

Users may only call this function and write to the buffer between calling begin_message() and end_message().

Note
The lower layers may pre-fill the buffer, e.g., to prefix custom headers.

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