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

Provides access to a resource that operates on a byte stream, e.g., a TCP socket. More...

#include <lower_layer.hpp>

Inheritance diagram for caf::net::octet_stream::lower_layer:
caf::net::generic_lower_layer

Public Member Functions

virtual bool is_reading () const noexcept=0
 Queries whether the transport is currently configured to read from its socket.
 
virtual void configure_read (receive_policy policy)=0
 Configures threshold for the next receive operations.
 
virtual void begin_output ()=0
 Prepares the layer for outgoing traffic, e.g., by allocating an output buffer as necessary.
 
virtual byte_bufferoutput_buffer ()=0
 Returns a reference to the output buffer.
 
virtual bool end_output ()=0
 Prepares written data for transfer, e.g., by flushing buffers or registering sockets for write events.
 
virtual void switch_protocol (std::unique_ptr< upper_layer > next)=0
 Asks the stream to swap the current upper layer with next after returning from consume().
 
virtual bool switching_protocol () const noexcept=0
 Queries whether switch_protocol has been called.
 
- 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 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 a byte stream, e.g., a TCP socket.

Member Function Documentation

◆ configure_read()

virtual void caf::net::octet_stream::lower_layer::configure_read ( receive_policy policy)
pure virtual

Configures threshold for the next receive operations.

Policies remain active until calling this function again.

Warning
Calling this function in consume invalidates both byte spans.

◆ is_reading()

virtual bool caf::net::octet_stream::lower_layer::is_reading ( ) const
pure virtualnoexcept

Queries whether the transport is currently configured to read from its socket.

Implements caf::net::generic_lower_layer.

◆ output_buffer()

virtual byte_buffer & caf::net::octet_stream::lower_layer::output_buffer ( )
pure virtual

Returns a reference to the output buffer.

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

◆ switch_protocol()

virtual void caf::net::octet_stream::lower_layer::switch_protocol ( std::unique_ptr< upper_layer > next)
pure virtual

Asks the stream to swap the current upper layer with next after returning from consume().

Note
may only be called from the upper layer in consume.

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