18namespace flow_control_error
176 void reset(uint64_t initial_window);
Connection-level flow control for QUIC (RFC 9000 Section 4)
auto should_send_max_data() const noexcept -> bool
Check if MAX_DATA frame should be sent.
auto bytes_consumed() const noexcept -> uint64_t
Get bytes consumed by application.
void update_send_limit(uint64_t max_data)
Update the send limit (from peer's MAX_DATA)
auto record_received(uint64_t bytes) -> VoidResult
Record received data.
flow_controller(uint64_t initial_window=1048576)
Construct a flow controller.
auto receive_limit() const noexcept -> uint64_t
Get our receive limit (advertised as MAX_DATA)
flow_controller(const flow_controller &)=default
~flow_controller()=default
auto is_send_blocked() const noexcept -> bool
Check if send is blocked.
void record_consumed(uint64_t bytes)
Record data consumed by application.
auto available_send_window() const noexcept -> uint64_t
Get available send window.
flow_controller(flow_controller &&) noexcept=default
auto should_send_data_blocked() const noexcept -> bool
Check if DATA_BLOCKED frame should be sent.
auto bytes_sent() const noexcept -> uint64_t
Get total bytes sent.
void mark_data_blocked_sent()
Mark DATA_BLOCKED as sent (to avoid repeated sending)
auto consume_send_window(uint64_t bytes) -> VoidResult
Try to consume send window for outgoing data.
uint64_t last_sent_max_data_
auto send_limit() const noexcept -> uint64_t
Get the current send limit (peer's MAX_DATA)
void reset(uint64_t initial_window)
Reset flow controller state.
void set_update_threshold(double threshold)
Set the threshold for sending MAX_DATA updates (0.0 - 1.0)
auto bytes_received() const noexcept -> uint64_t
Get total bytes received.
auto generate_max_data() -> std::optional< uint64_t >
Generate MAX_DATA value if update needed.
auto operator=(const flow_controller &) -> flow_controller &=default
auto window_size() const noexcept -> uint64_t
Get the current window size.
void set_window_size(uint64_t window)
Set the window size for auto-tuning.
constexpr int receive_overflow
constexpr int send_blocked
constexpr int window_exceeded
auto get_flow_control_stats(const flow_controller &fc) -> flow_control_stats
Get flow control statistics.
Result< std::monostate > VoidResult
Network-specific error and result type definitions.
Statistics for flow control monitoring.
uint64_t receive_window_available
uint64_t send_window_available