Skip to content

Commit

Permalink
debug connections
Browse files Browse the repository at this point in the history
  • Loading branch information
feschber committed Nov 7, 2024
1 parent 9593b97 commit 3e62739
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/emulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3e62739

Please sign in to comment.