Made the GDB stub more foolproof
@@ -37,11 +37,6 @@ async fn accept_loop(addr: impl ToSocketAddrs, session: Arc<Mutex<Session>>) ->
let (tbd_sender, tbd_receiver) = mpsc::unbounded();
let stream = Arc::new(stream?);
- // let outbound_broker_handle = task::spawn(outbound_broker_loop(
- // Arc::clone(&stream),
- // packet_stream_receiver,
- // Arc::clone(&acks_due),
- // ));
let inbound_broker_handle = task::spawn(inbound_broker_loop(
Arc::clone(&stream),
tbd_sender,
@@ -55,8 +50,15 @@ async fn accept_loop(addr: impl ToSocketAddrs, session: Arc<Mutex<Session>>) ->
));
println!("Accepted a new connection from: {}", stream.peer_addr()?);
// outbound_broker_handle.await?;
- inbound_broker_handle.await?;
- worker.await?;
+ if let Err(e) = inbound_broker_handle.await {
+ eprintln!("An error with the current connection has been encountered. It has been closed.");
+ eprintln!("{:?}", e);
+ }
+
+ if let Err(e) = worker.await {
+ eprintln!("An error with the current connection has been encountered. It has been closed.");
+ eprintln!("{:?}", e);
+ }
}
Ok(())
}
