C++ Actor Framework 1.0.0
|
Parses HTTP requests and passes them to the upper layer. More...
#include <lower_layer.hpp>
Public Member Functions | |
virtual void | request_messages ()=0 |
Start or re-start reading data from the client. | |
virtual void | suspend_reading ()=0 |
Stops reading messages until calling request_messages . | |
virtual void | add_header_field (std::string_view key, std::string_view val)=0 |
Adds a header field. | |
virtual bool | end_header ()=0 |
Seals the header and transports it to the client. | |
virtual bool | send_payload (const_byte_span bytes)=0 |
Sends the payload after the header. | |
virtual bool | send_chunk (const_byte_span bytes)=0 |
Sends a chunk of data if the full payload is unknown when starting to send. | |
virtual bool | send_end_of_chunks ()=0 |
Sends the last chunk, completing a chunked payload. | |
virtual void | switch_protocol (std::unique_ptr< octet_stream::upper_layer > next)=0 |
Asks the stream to swap the HTTP layer with next after returning from consume . | |
Public Member Functions inherited from caf::net::generic_lower_layer | |
multiplexer & | mpx () noexcept |
Returns the multiplexer instance that executes this protocol stack. | |
virtual socket_manager * | manager () 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. | |
Parses HTTP requests and passes them to the upper layer.
|
pure virtual |
Adds a header field.
Users may only call this function between begin_header
and end_header
.
|
pure virtual |
Asks the stream to swap the HTTP layer with next
after returning from consume
.
consume
.