mirror of
https://github.com/rustdesk/hbb_common.git
synced 2026-10-11 19:23:59 +00:00
c50c1fef326de134ad2b15e7cfbf92133c9cefc8
A peer that is killed, logged out or rebooted sends no reset over UDP, so a session only learns of it by timing out. Nothing here acts on that; these are the two observations a caller needs to. `rx_progress` counts arriving fragments. A message reaches the caller only once it is whole, so a large one - a clipboard image is the case that occurs - leaves the receive loop with nothing to observe for as long as the transfer takes, and a peer sending steadily looks exactly like one that died. A counter, not a timestamp: `Instant::now()` costs an order of magnitude more per read, and callers only compare successive samples. `webrtc_disconnected` exposes the ICE state webrtc-rs already raises ~5s after it stops hearing from the peer. It is deliberately not a fourth `WebRTCConnectionState`: that enum gates send and receive readiness and session cache admissibility, and a transient state must change neither. TCP and WebSocket answer for neither, on purpose: this change leaves their existing close, error and timeout behaviour exactly as it was. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns
Description
No description provided
74 MiB
Languages
Rust
100%