diff --git a/server/src/main.rs b/server/src/main.rs index b40d6dc..9c36731 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -158,7 +158,13 @@ impl Relay for Handler { .map(|b| format!("{b:02X}")).collect::>().join(" ")); break; }, - Err(e) if matches!(e.raw_os_error(), Some(libc::EBUSY) | Some(libc::EAGAIN)) => { + Err(e) + if matches!(e.raw_os_error(), + Some(libc::EBUSY) | // still opening + Some(libc::ENODEV) | // gadget not‑yet configured + Some(libc::EPIPE) | // host vanished + Some(libc::EAGAIN)) // non‑blocking + => { tokio::time::sleep(Duration::from_millis(10)).await; continue; } @@ -191,7 +197,13 @@ impl Relay for Handler { .map(|b| format!("{b:02X}")).collect::>().join(" ")); break; } - Err(e) if matches!(e.raw_os_error(), Some(libc::EBUSY) | Some(libc::EAGAIN)) => { + Err(e) + if matches!(e.raw_os_error(), + Some(libc::EBUSY) | // still opening + Some(libc::ENODEV) | // gadget not‑yet configured + Some(libc::EPIPE) | // host vanished + Some(libc::EAGAIN)) // non‑blocking + => { tokio::time::sleep(Duration::from_millis(10)).await; continue; }