diff --git a/crates/core/src/bc_protocol/connection/bcconn.rs b/crates/core/src/bc_protocol/connection/bcconn.rs index 63cdf93..6cff8d4 100644 --- a/crates/core/src/bc_protocol/connection/bcconn.rs +++ b/crates/core/src/bc_protocol/connection/bcconn.rs @@ -193,6 +193,15 @@ impl Poller { async fn run(&mut self) -> Result<()> { while let Some(command) = self.reciever.next().await { yield_now().await; + // Clean Up subscribers + self.subscribers + .num + .iter_mut() + .for_each(|(_, channels)| channels.retain(|_, channel| !channel.is_closed())); + self.subscribers + .num + .retain(|_, channels| !channels.is_empty()); + // Handle the command match command { PollCommand::Bc(boxed_response) => { match *boxed_response { diff --git a/crates/core/src/bc_protocol/ping.rs b/crates/core/src/bc_protocol/ping.rs index 6426536..5f76f1f 100644 --- a/crates/core/src/bc_protocol/ping.rs +++ b/crates/core/src/bc_protocol/ping.rs @@ -27,6 +27,7 @@ impl BcCamera { sub_ping.recv().await?; + log::trace!("Ping complete"); Ok(()) } }