mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-14 16:51:28 +03:00
debug connections
This commit is contained in:
@@ -144,9 +144,14 @@ impl LanMouseConnection {
|
|||||||
log::warn!("client ({handle}) @ {addr} connection closed: {e}");
|
log::warn!("client ({handle}) @ {addr} connection closed: {e}");
|
||||||
conns.lock().await.remove(&addr);
|
conns.lock().await.remove(&addr);
|
||||||
server.set_active_addr(handle, None);
|
server.set_active_addr(handle, None);
|
||||||
|
let active: Vec<SocketAddr> =
|
||||||
|
conns.lock().await.keys().copied().collect();
|
||||||
|
log::info!("active connections: {active:?}");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tokio::time::sleep(Duration::from_millis(500)).await;
|
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() => {
|
_ = interval.tick() => {
|
||||||
last_response.retain(|addr,instant| {
|
last_response.retain(|addr,instant| {
|
||||||
if instant.elapsed() > Duration::from_secs(5) {
|
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);
|
emulation_proxy.release_keys(*addr);
|
||||||
false
|
false
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user