Network System 0.1.1
High-performance modular networking library for scalable client-server applications
Loading...
Searching...
No Matches
kcenon::network::internal::socket_config Struct Reference

Configuration for TCP socket backpressure control. More...

#include <common_defs.h>

Collaboration diagram for kcenon::network::internal::socket_config:
Collaboration graph

Public Attributes

std::size_t max_pending_bytes {0}
 Maximum bytes allowed in pending send buffer.
 
std::size_t high_water_mark {1024 * 1024}
 High water mark - trigger backpressure callback.
 
std::size_t low_water_mark {256 * 1024}
 Low water mark - resume sending.
 

Detailed Description

Configuration for TCP socket backpressure control.

Backpressure Overview

Backpressure prevents memory exhaustion when sending to slow receivers. When pending bytes exceed high_water_mark, the backpressure callback is invoked. When bytes drop below low_water_mark, sending can resume.

Default Behavior

With max_pending_bytes=0, backpressure is disabled (unlimited buffering).

Definition at line 29 of file common_defs.h.

Member Data Documentation

◆ high_water_mark

std::size_t kcenon::network::internal::socket_config::high_water_mark {1024 * 1024}

High water mark - trigger backpressure callback.

When pending bytes reach this threshold, the backpressure callback is invoked with true to signal the sender to slow down. Default: 1MB

Definition at line 47 of file common_defs.h.

47{1024 * 1024};

◆ low_water_mark

std::size_t kcenon::network::internal::socket_config::low_water_mark {256 * 1024}

Low water mark - resume sending.

When pending bytes drop to this threshold after being above high_water_mark, the backpressure callback is invoked with false to signal that sending can resume. Default: 256KB

Definition at line 57 of file common_defs.h.

57{256 * 1024};

◆ max_pending_bytes

std::size_t kcenon::network::internal::socket_config::max_pending_bytes {0}

Maximum bytes allowed in pending send buffer.

When this limit is reached, try_send() returns false and new sends are rejected until buffer drains. Set to 0 for unlimited (default, backward compatible).

Definition at line 38 of file common_defs.h.

38{0};

The documentation for this struct was generated from the following file: