fix not disconnecting when backend kicks player
All checks were successful
Build and Test / splatoon (push) Successful in 4m4s
Build and Test / wii-u-chat (push) Successful in 4m4s
Build and Test / super-mario-maker (push) Successful in 4m55s
Build and Test / fast-racing-neo (push) Successful in 5m12s
Build and Test / splatoon-testfire (push) Successful in 5m55s
Build and Test / puyopuyo (push) Successful in 5m55s
Build and Test / minecraft-wiiu (push) Successful in 7m13s
Build and Test / friends (push) Successful in 7m34s
Build and Test / wii-sports-club (push) Successful in 8m7s
Build and Test / mario-tennis (push) Successful in 8m34s
All checks were successful
Build and Test / splatoon (push) Successful in 4m4s
Build and Test / wii-u-chat (push) Successful in 4m4s
Build and Test / super-mario-maker (push) Successful in 4m55s
Build and Test / fast-racing-neo (push) Successful in 5m12s
Build and Test / splatoon-testfire (push) Successful in 5m55s
Build and Test / puyopuyo (push) Successful in 5m55s
Build and Test / minecraft-wiiu (push) Successful in 7m13s
Build and Test / friends (push) Successful in 7m34s
Build and Test / wii-sports-club (push) Successful in 8m7s
Build and Test / mario-tennis (push) Successful in 8m34s
This commit is contained in:
parent
9ebf88d8eb
commit
f66ecf4d96
1 changed files with 6 additions and 5 deletions
|
|
@ -75,16 +75,16 @@ pub async fn start(param: ProxyStartupParam) {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
loop {
|
'a: loop {
|
||||||
tokio::select! {
|
tokio::select! {
|
||||||
data = conn.recv() => {
|
data = conn.recv() => {
|
||||||
let Some(data) = data else {
|
let Some(data) = data else {
|
||||||
return;
|
break 'a;
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Err(e) = stream.send_buffer(&data[..]).await{
|
if let Err(e) = stream.send_buffer(&data[..]).await{
|
||||||
error!("error sending data to backend: {}", e);
|
error!("error sending data to backend: {}", e);
|
||||||
return;
|
break 'a;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data = stream.read_buffer() => {
|
data = stream.read_buffer() => {
|
||||||
|
|
@ -92,12 +92,12 @@ pub async fn start(param: ProxyStartupParam) {
|
||||||
Ok(d) => d,
|
Ok(d) => d,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!("error reveiving data from backend: {}", e);
|
error!("error reveiving data from backend: {}", e);
|
||||||
return;
|
break 'a;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if conn.send(data).await == None{
|
if conn.send(data).await == None{
|
||||||
return;
|
break 'a;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_ = sleep(Duration::from_secs(10)) => {
|
_ = sleep(Duration::from_secs(10)) => {
|
||||||
|
|
@ -105,6 +105,7 @@ pub async fn start(param: ProxyStartupParam) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
conn.close_connection().await;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue