aquatic_ws: improve channel sending error handling

This commit is contained in:
Joakim Frostegård 2021-11-02 12:06:53 +01:00
parent 6140596d7e
commit 98237c928f
2 changed files with 12 additions and 10 deletions

View file

@ -159,11 +159,14 @@ async fn receive_out_messages(
.borrow()
.get(channel_out_message.0.connection_id.0)
{
if let Err(err) = reference.out_message_sender.try_send(channel_out_message) {
::log::error!(
"Couldn't send out_message from shared channel to local receiver: {:?}",
err
);
match reference.out_message_sender.try_send(channel_out_message) {
Ok(()) | Err(GlommioError::Closed(_)) => {},
Err(err) => {
::log::error!(
"Couldn't send out_message from shared channel to local receiver: {:?}",
err
);
}
}
}
}