|
Network System 0.1.1
High-performance modular networking library for scalable client-server applications
|
DATA frame (RFC 7540 Section 6.1) More...
#include <frame.h>


Public Member Functions | |
| data_frame (uint32_t stream_id, std::vector< uint8_t > data, bool end_stream=false, bool padded=false) | |
| Construct DATA frame. | |
| auto | is_end_stream () const -> bool |
| Check if END_STREAM flag is set. | |
| auto | is_padded () const -> bool |
| Check if frame is padded. | |
| auto | data () const -> std::span< const uint8_t > |
| Get actual data (without padding) | |
Public Member Functions inherited from kcenon::network::protocols::http2::frame | |
| frame ()=default | |
| Default constructor. | |
| frame (const frame_header &hdr, std::vector< uint8_t > payload) | |
| Construct frame with header and payload. | |
| auto | serialize () const -> std::vector< uint8_t > |
| Serialize frame to bytes. | |
| auto | header () const -> const frame_header & |
| Get frame header. | |
| auto | payload () const -> std::span< const uint8_t > |
| Get frame payload. | |
| virtual | ~frame ()=default |
| Virtual destructor. | |
Static Public Member Functions | |
| static auto | parse (const frame_header &hdr, std::span< const uint8_t > payload) -> Result< std::unique_ptr< data_frame > > |
| Parse DATA frame from raw bytes. | |
Static Public Member Functions inherited from kcenon::network::protocols::http2::frame | |
| static auto | parse (std::span< const uint8_t > data) -> Result< std::unique_ptr< frame > > |
| Parse frame from raw bytes. | |
Private Attributes | |
| std::vector< uint8_t > | data_ |
| Actual data without padding. | |
Additional Inherited Members | |
Protected Attributes inherited from kcenon::network::protocols::http2::frame | |
| frame_header | header_ |
| Frame header. | |
| std::vector< uint8_t > | payload_ |
| Frame payload. | |
DATA frame (RFC 7540 Section 6.1)
DATA frames convey arbitrary, variable-length sequences of octets associated with a stream.
| kcenon::network::protocols::http2::data_frame::data_frame | ( | uint32_t | stream_id, |
| std::vector< uint8_t > | data, | ||
| bool | end_stream = false, | ||
| bool | padded = false ) |
Construct DATA frame.
| stream_id | Stream identifier |
| data | Payload data |
| end_stream | True if this is the last frame in stream |
| padded | True if frame is padded |
Definition at line 190 of file frame.cpp.
References kcenon::network::protocols::http2::data, data_, kcenon::network::protocols::http2::frame_flags::end_stream, kcenon::network::protocols::http2::frame_header::flags, kcenon::network::protocols::http2::frame::header_, kcenon::network::protocols::http2::frame_header::length, kcenon::network::protocols::http2::frame_flags::none, kcenon::network::protocols::http2::frame_flags::padded, kcenon::network::protocols::http2::frame::payload_, kcenon::network::protocols::http2::frame_header::stream_id, and kcenon::network::protocols::http2::frame_header::type.
| auto kcenon::network::protocols::http2::data_frame::data | ( | ) | const -> std::span<const uint8_t> |
| auto kcenon::network::protocols::http2::data_frame::is_end_stream | ( | ) | const -> bool |
Check if END_STREAM flag is set.
Definition at line 257 of file frame.cpp.
References kcenon::network::protocols::http2::frame_flags::end_stream, kcenon::network::protocols::http2::frame_header::flags, and kcenon::network::protocols::http2::frame::header_.
| auto kcenon::network::protocols::http2::data_frame::is_padded | ( | ) | const -> bool |
Check if frame is padded.
Definition at line 262 of file frame.cpp.
References kcenon::network::protocols::http2::frame_header::flags, kcenon::network::protocols::http2::frame::header_, and kcenon::network::protocols::http2::frame_flags::padded.
|
static |
Parse DATA frame from raw bytes.
| hdr | Frame header (must be DATA type) |
| payload | Frame payload |
Definition at line 213 of file frame.cpp.
References kcenon::network::protocols::http2::data, kcenon::network::protocols::http2::frame_flags::end_stream, and kcenon::network::protocols::http2::frame_flags::padded.
Referenced by kcenon::network::protocols::http2::frame::parse().

|
private |
Actual data without padding.
Definition at line 179 of file frame.h.
Referenced by data(), and data_frame().