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

Parses HTTP requests and passes them to the upper layer. More...

#include <lower_layer.hpp>

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

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
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 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.
 

Detailed Description

Parses HTTP requests and passes them to the upper layer.

Member Function Documentation

◆ add_header_field()

virtual void caf::net::http::lower_layer::add_header_field ( std::string_view key,
std::string_view val )
pure virtual

Adds a header field.

Users may only call this function between begin_header and end_header.

◆ switch_protocol()

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

Asks the stream to swap the HTTP 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: