From 3e62739f7e6e1e606d5da54496809a9904be2afc Mon Sep 17 00:00:00 2001 From: Ferdinand Schober Date: Mon, 16 Sep 2024 21:33:25 +0200 Subject: [PATCH] debug connections --- src/connect.rs | 5 +++++ src/emulation.rs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/connect.rs b/src/connect.rs index 574b7d03..4054178f 100644 --- a/src/connect.rs +++ b/src/connect.rs @@ -144,9 +144,14 @@ impl LanMouseConnection { log::warn!("client ({handle}) @ {addr} connection closed: {e}"); conns.lock().await.remove(&addr); server.set_active_addr(handle, None); + let active: Vec = + conns.lock().await.keys().copied().collect(); + log::info!("active connections: {active:?}"); break; } tokio::time::sleep(Duration::from_millis(500)).await; + let mut buf = [0u8; MAX_EVENT_SIZE]; + conn.recv(&mut buf).await; } }); } diff --git a/src/emulation.rs b/src/emulation.rs index 35b8e1fb..f5837060 100644 --- a/src/emulation.rs +++ b/src/emulation.rs @@ -60,7 +60,7 @@ impl Emulation { _ = interval.tick() => { last_response.retain(|addr,instant| { if instant.elapsed() > Duration::from_secs(5) { - log::warn!("{addr} is not responding, releasing keys!"); + log::warn!("releasing keys: {addr} not responding!"); emulation_proxy.release_keys(*addr); false } else {