fixed issue causing it not to exit on disconnect

Signed-off-by: Nickiel12 <nickiel@nickiel.net>
This commit is contained in:
Nickiel12 2024-09-18 14:24:47 -07:00
parent 04ec4fff8f
commit d8def332bf

View file

@ -259,6 +259,7 @@ async fn main() {
} }
}; };
} }
info!("Closing send_rtp messages thread");
}); });
info!("starting webrtc connection kickoff"); info!("starting webrtc connection kickoff");
@ -287,12 +288,16 @@ async fn main() {
info!("Event Loop cancelled flag caught"); info!("Event Loop cancelled flag caught");
break; break;
} }
Ok(msg) = app_receiver.recv() => { val = app_receiver.recv() => {
if val.is_err() {
break;
}
if to_quit.load(Ordering::SeqCst) { if to_quit.load(Ordering::SeqCst) {
info!("ToQuit set, breaking app_receiver set"); info!("ToQuit set, breaking app_receiver set");
break; break;
} }
match msg { match val.unwrap() {
ApplicationMessage::ConnectionSupportsWebRTC(_) => {}, ApplicationMessage::ConnectionSupportsWebRTC(_) => {},
ApplicationMessage::ConnectionSupportsWebRTCRequest => { ApplicationMessage::ConnectionSupportsWebRTCRequest => {
if let Err(e) = app_sender.send(ApplicationMessage::ConnectionSupportsWebRTC(do_webrtc)).await { if let Err(e) = app_sender.send(ApplicationMessage::ConnectionSupportsWebRTC(do_webrtc)).await {