mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-24 13:40:55 +03:00
improve logging, remove failed connection
This commit is contained in:
@@ -90,6 +90,8 @@ impl LanMouseConnection {
|
||||
Ok(_) => return Ok(()),
|
||||
Err(e) => {
|
||||
log::warn!("failed to connect: {e}");
|
||||
self.conns.lock().await.remove(&addr);
|
||||
self.server.set_active_addr(handle, None);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,8 +119,10 @@ impl LanMouseConnection {
|
||||
.into_iter()
|
||||
.map(|a| SocketAddr::new(a, port))
|
||||
.collect::<Vec<_>>();
|
||||
log::info!("client ({handle}) connecting ... (ips: {addrs:?})");
|
||||
let (conn, addr) = connect_any(&addrs).await?;
|
||||
server.set_active_addr(handle, addr);
|
||||
log::info!("client ({handle}) connected @ {addr}");
|
||||
server.set_active_addr(handle, Some(addr));
|
||||
conns.lock().await.insert(addr, conn);
|
||||
connecting.lock().await.remove(&handle);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user