From 72c30620106e8e1bafb307958219f1163de6bc76 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Mon, 28 Mar 2022 18:05:02 +0200 Subject: [PATCH] Delay pinger on stream bind Given the serial state machine implemented by lib-gst-meet, it was expecting an answer to the extdisco:2 iq but got a pong, and wrongly assumed no STUN/TURN candidates were exposed by the server. A much better solution would be to match on the iq id as well, but this will do as a workaround. --- lib-gst-meet/src/pinger.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib-gst-meet/src/pinger.rs b/lib-gst-meet/src/pinger.rs index fcd3061..1f16c5b 100644 --- a/lib-gst-meet/src/pinger.rs +++ b/lib-gst-meet/src/pinger.rs @@ -22,6 +22,8 @@ impl Pinger { let ping_tx = tx.clone(); let ping_task = tokio::spawn(async move { let mut interval = time::interval(PING_INTERVAL); + // The first tick completes immediately. + interval.tick().await; loop { interval.tick().await; if let Err(e) = ping_tx.send(Iq::from_get(generate_id(), Ping).into()).await {