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


Public Member Functions | |
| ping_frame (std::array< uint8_t, 8 > opaque_data={}, bool ack=false) | |
| Construct PING frame. | |
| auto | opaque_data () const -> const std::array< uint8_t, 8 > & |
| Get opaque data. | |
| auto | is_ack () const -> bool |
| Check if this is an ACK frame. | |
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< ping_frame > > |
| Parse PING 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::array< uint8_t, 8 > | opaque_data_ |
| 8-byte opaque data | |
Additional Inherited Members | |
Protected Attributes inherited from kcenon::network::protocols::http2::frame | |
| frame_header | header_ |
| Frame header. | |
| std::vector< uint8_t > | payload_ |
| Frame payload. | |
PING frame (RFC 7540 Section 6.7)
PING frames are a mechanism for measuring a minimal round-trip time from the sender and for determining whether an idle connection is still functional.
|
explicit |
Construct PING frame.
| opaque_data | 8-byte opaque data |
| ack | True if this is an acknowledgment |
Definition at line 455 of file frame.cpp.
References kcenon::network::protocols::http2::frame_flags::ack, 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, opaque_data_, kcenon::network::protocols::http2::frame::payload_, kcenon::network::protocols::http2::ping, kcenon::network::protocols::http2::frame_header::stream_id, and kcenon::network::protocols::http2::frame_header::type.
| auto kcenon::network::protocols::http2::ping_frame::is_ack | ( | ) | const -> bool |
Check if this is an ACK frame.
Definition at line 490 of file frame.cpp.
References kcenon::network::protocols::http2::frame_flags::ack, kcenon::network::protocols::http2::frame_header::flags, and kcenon::network::protocols::http2::frame::header_.
| auto kcenon::network::protocols::http2::ping_frame::opaque_data | ( | ) | const -> const std::array<uint8_t, 8>& |
Get opaque data.
Definition at line 485 of file frame.cpp.
References opaque_data_.
|
static |
Parse PING frame from raw bytes.
| hdr | Frame header (must be PING type) |
| payload | Frame payload |
Definition at line 466 of file frame.cpp.
References kcenon::network::protocols::http2::frame_flags::ack.
Referenced by kcenon::network::protocols::http2::frame::parse().

|
private |
8-byte opaque data
Definition at line 376 of file frame.h.
Referenced by opaque_data(), and ping_frame().