Add restarts to the send thread
This commit is contained in:
2 files changed
+15
-6
No files matched your search
+13
-4
@@ -124,7 +124,7 @@ impl Drop for NeoMediaFactoryImpl {
|
||||
|
||||
impl Default for NeoMediaFactoryImpl {
|
||||
fn default() -> Self {
|
||||
warn!("Constructing Factor Impl");
|
||||
debug!("Constructing Factor Impl");
|
||||
let (datasender, datarx) = channel(3);
|
||||
let (clientsender, rx_clientsender) = channel(3);
|
||||
let shared: Arc<NeoMediaShared> = Default::default();
|
||||
@@ -140,9 +140,18 @@ impl Default for NeoMediaFactoryImpl {
|
||||
waiting_for_iframe: true,
|
||||
};
|
||||
threads.spawn(async move {
|
||||
let res = sender.run().await;
|
||||
error!("Factory Run thread stopped: {:?}", res);
|
||||
res
|
||||
loop {
|
||||
match sender.run().await {
|
||||
Err(e) => {
|
||||
warn!("Media send thead failed... restarting. Cause: {:?}", e);
|
||||
}
|
||||
Ok(()) => {
|
||||
break;
|
||||
}
|
||||
}
|
||||
sender.waiting_for_iframe = true;
|
||||
}
|
||||
Ok(())
|
||||
});
|
||||
|
||||
Self {
|
||||
|
||||
@@ -296,10 +296,10 @@ impl NeoMediaSender {
|
||||
.await;
|
||||
match &res {
|
||||
Err(e) => {
|
||||
error!("Failed to send buffer: {:?}", e);
|
||||
debug!("Failed to send buffer: {:?}", e);
|
||||
}
|
||||
Ok(Err(e)) => {
|
||||
error!("Failed to send buffer: {:?}", e);
|
||||
debug!("Failed to send buffer: {:?}", e);
|
||||
}
|
||||
Ok(Ok(_)) => {}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user