Skip to content

Commit

Permalink
fix(server): 🐛 Fix busy loop in server handshake
Browse files Browse the repository at this point in the history
  • Loading branch information
zmerp committed Dec 3, 2023
1 parent a80f384 commit 3065888
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion alvr/server/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,15 @@ pub fn handshake_loop() {
warn!("UDP handshake listening error: {e:?}");

thread::sleep(RETRY_CONNECT_MIN_INTERVAL);

continue;
}
};

if clients.is_empty() {
thread::sleep(RETRY_CONNECT_MIN_INTERVAL);
continue;
}

for (client_hostname, client_ip) in clients {
let trusted = {
let mut data_manager = SERVER_DATA_MANAGER.write();
Expand Down Expand Up @@ -290,6 +294,8 @@ pub fn handshake_loop() {

thread::sleep(RETRY_CONNECT_MIN_INTERVAL);
}
} else {
thread::sleep(RETRY_CONNECT_MIN_INTERVAL);
}
}

Expand Down

0 comments on commit 3065888

Please sign in to comment.