mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-27 07:00:53 +03:00
fix error handling in portchange
This commit is contained in:
@@ -255,9 +255,8 @@ impl Server {
|
|||||||
let _ = receiver_tx.send(event).await;
|
let _ = receiver_tx.send(event).await;
|
||||||
}
|
}
|
||||||
event = sender_rx.recv() => {
|
event = sender_rx.recv() => {
|
||||||
let (event, addr) = match event {
|
let Some((event, addr)) = event else {
|
||||||
Some(e) => e,
|
break;
|
||||||
None => break,
|
|
||||||
};
|
};
|
||||||
if let Err(e) = send_event(&socket, event, addr) {
|
if let Err(e) = send_event(&socket, event, addr) {
|
||||||
log::warn!("udp send failed: {e}");
|
log::warn!("udp send failed: {e}");
|
||||||
@@ -270,7 +269,7 @@ impl Server {
|
|||||||
let current_port = socket.local_addr().unwrap().port();
|
let current_port = socket.local_addr().unwrap().port();
|
||||||
if current_port == port {
|
if current_port == port {
|
||||||
let _ = frontend_notify_tx.send(FrontendNotify::NotifyPortChange(port, None)).await;
|
let _ = frontend_notify_tx.send(FrontendNotify::NotifyPortChange(port, None)).await;
|
||||||
return;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
let listen_addr = SocketAddr::new("0.0.0.0".parse().unwrap(), port);
|
let listen_addr = SocketAddr::new("0.0.0.0".parse().unwrap(), port);
|
||||||
|
|||||||
Reference in New Issue
Block a user