Consumes lp messages from the lower layer.
More...
#include <upper_layer.hpp>
|
virtual error | start (lower_layer *down)=0 |
| Initializes the upper layer.
|
|
virtual ptrdiff_t | consume (byte_span payload)=0 |
| Consumes bytes from the lower 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.
|
|
Consumes lp messages from the lower layer.
◆ consume()
virtual ptrdiff_t caf::net::lp::upper_layer::consume |
( |
byte_span | payload | ) |
|
|
nodiscardpure virtual |
Consumes bytes from the lower layer.
- Parameters
-
payload | Payload of the received message. |
- Returns
- The number of consumed bytes or a negative value to signal an error.
- Note
- Discarded data is lost permanently.
◆ start()
Initializes the upper layer.
- Parameters
-
down | A 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:
- libcaf_net/caf/net/lp/upper_layer.hpp
- libcaf_net/caf/net/lp/upper_layer.cpp