Fix active client handling

This commit is contained in:
htrefil 2020-10-23 21:11:30 +02:00
parent 941cb5b191
commit 7df1f0747e

View file

@ -113,11 +113,12 @@ async fn run(listen_address: SocketAddr, switch_keys: &HashSet<u16>) -> Result<I
}
if current != 0 {
if clients[current - 1].send(event).is_ok() {
let idx = current - 1;
if clients[idx].send(event).is_ok() {
continue;
}
clients.remove(current);
clients.remove(idx);
current = 0;
}