Skip to content

feat(rtc-tcp-client): add TCP backpressure via on_flow_control hook - #36

Draft
sedawwk wants to merge 1 commit into
masterfrom
feature/tai-backpressure
Draft

sedawwk wants to merge 1 commit into
masterfrom
feature/tai-backpressure

Conversation

@sedawwk

@sedawwk sedawwk commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

The worker calls the app's on_flow_control hook before each recv and between buffered frames; when it returns 0 the read is skipped so the lwIP receive window closes and stalls the sender. Buffered frames resume without requiring new network data. Add worker_yield (zero-event tcp_poll) so single-core targets (ESP32-C3) cannot starve the IDLE task and trip the task watchdog under a TTS flood. New knobs: TAI_FLOW_CONTROL_POLL_MS and TAI_WORKER_YIELD_MS. Integration test covers per-packet pause, resume without new bytes, and disconnect while paused.

The worker calls the app's on_flow_control hook before each recv and
between buffered frames; when it returns 0 the read is skipped so the
lwIP receive window closes and stalls the sender. Buffered frames resume
without requiring new network data. Add worker_yield (zero-event
tcp_poll) so single-core targets (ESP32-C3) cannot starve the IDLE task
and trip the task watchdog under a TTS flood. New knobs:
TAI_FLOW_CONTROL_POLL_MS and TAI_WORKER_YIELD_MS. Integration test
covers per-packet pause, resume without new bytes, and disconnect while
paused.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant