mirror of
https://github.com/htrefil/rkvm.git
synced 2025-01-30 20:34:13 +01:00
Fix active client handling
This commit is contained in:
parent
941cb5b191
commit
7df1f0747e
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue