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.
This commit is contained in:
Emmanuel Gil Peyrot 2022-03-28 18:05:02 +02:00 committed by Jasper
parent f5be3d8f41
commit 72c3062010
1 changed files with 2 additions and 0 deletions

View File

@ -22,6 +22,8 @@ impl Pinger {
let ping_tx = tx.clone(); let ping_tx = tx.clone();
let ping_task = tokio::spawn(async move { let ping_task = tokio::spawn(async move {
let mut interval = time::interval(PING_INTERVAL); let mut interval = time::interval(PING_INTERVAL);
// The first tick completes immediately.
interval.tick().await;
loop { loop {
interval.tick().await; interval.tick().await;
if let Err(e) = ping_tx.send(Iq::from_get(generate_id(), Ping).into()).await { if let Err(e) = ping_tx.send(Iq::from_get(generate_id(), Ping).into()).await {