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

The upper layer requests bytes from the lower layer and consumes raw chunks of data. More...

#include <upper_layer.hpp>

Inheritance diagram for caf::net::octet_stream::upper_layer:
caf::net::generic_upper_layer caf::net::http::client caf::net::http::server caf::net::lp::framing caf::net::web_socket::client caf::net::web_socket::framing caf::net::web_socket::server

Public Member Functions

virtual error start (lower_layer *down)=0
 Initializes the upper layer.
 
virtual ptrdiff_t consume (byte_span buffer, byte_span delta)=0
 Consumes bytes from the lower layer.
 
virtual void written (size_t num_bytes)
 Called from the lower layer whenever data has been written.
 
- Public Member Functions inherited from caf::net::generic_upper_layer
virtual void prepare_send ()=0
 Gives the upper layer an opportunity to add additional data to the output buffer.
 
virtual bool done_sending ()=0
 Queries whether all pending data has been sent.
 
virtual void abort (const error &reason)=0
 Called by the lower layer for cleaning up any state in case of an error or when disposed.
 

Detailed Description

The upper layer requests bytes from the lower layer and consumes raw chunks of data.

Member Function Documentation

◆ consume()

virtual ptrdiff_t caf::net::octet_stream::upper_layer::consume ( byte_span buffer,
byte_span delta )
nodiscardpure virtual

Consumes bytes from the lower layer.

Parameters
bufferAvailable bytes to read.
deltaBytes that arrived since last calling this function.
Returns
The number of consumed bytes. May be zero if waiting for more input or negative to signal an error.

◆ start()

virtual error caf::net::octet_stream::upper_layer::start ( lower_layer * down)
pure virtual

Initializes the upper layer.

Parameters
downA pointer to the lower layer that remains valid for the lifetime of the upper layer.

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