mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-06-11 11:56:18 +00:00
Why: _receive_count incremented inside data_received(), which fires once per TCP read — not once per completed MeshCore frame. Under TCP fragmentation a single frame can arrive in multiple segments, inflating _receive_count relative to _send_count. The disconnect-detection heuristic (send_count - receive_count >= 5) then never fires because the receive side is over-counted. Moving the increment into handle_rx after a complete frame is assembled makes the counter semantically correct: one increment per MeshCore frame dispatched to the reader. Refs: Forensics report finding N04