mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-07 11:59:59 +03:00
debug connections
This commit is contained in:
@@ -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<SocketAddr> =
|
||||
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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user