From dfbbe01a24320ae2fc3f517795d818e24f63e634 Mon Sep 17 00:00:00 2001 From: Jared Burce Date: Thu, 15 Oct 2020 11:44:40 -0700 Subject: [PATCH] Log client disconnected on ring sse This is only detected when ring sse attempts to send on the closed channel. It is not detected when the client actually disconnects. Lower layers in the stack do notice the disconnect and drop the sse stream so pings will stop being sent, but we don't have any drop handler on the ring substream so we don't notice until we try to use it. --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index c066d84..e5bb914 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,7 +17,7 @@ fn button_pressed(_level: Level, clients: &Arc; match tx.try_send(()) { Ok(_) => true, Err(mpsc::error::TrySendError::Full(_)) => true, // we just get some free debouncing - Err(mpsc::error::TrySendError::Closed(_)) => false + Err(mpsc::error::TrySendError::Closed(_)) => { info!("Event client disconnected"); false } } }); }