|
C++ Actor Framework 0.19
|
Provides access to a resource that operates on a byte stream, e.g., a TCP socket. More...
#include <lower_layer.hpp>
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_buffer & | output_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 | |
| virtual multiplexer & | mpx () noexcept=0 |
| Returns the multiplexer instance that executes this protocol stack. | |
| 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 du to an error. | |
Provides access to a resource that operates on a byte stream, e.g., a TCP socket.
|
pure virtual |
Configures threshold for the next receive operations.
Policies remain active until calling this function again.
consume invalidates both byte spans.
|
pure virtualnoexcept |
Queries whether the transport is currently configured to read from its socket.
Implements caf::net::generic_lower_layer.
|
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().
|
pure virtual |
Asks the stream to swap the current upper layer with next after returning from consume().
consume.