Skip to content

Commit c347e1f

Browse files
committed
fix: Waiting for ICE response
1 parent 775c52e commit c347e1f

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

gamestreaming_webrtc/src/client.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,18 @@ impl GamestreamingClient {
214214
.set_ice(session, ice_candidate_init)
215215
.await
216216
.map_err(GsError::ApiError)?;
217-
self.api.get_ice(session)
218-
.await
217+
218+
let mut ice_result = self.api.get_ice(session).await;
219+
220+
while ice_result.is_err() {
221+
ice_result = self.api.get_ice(session)
222+
.await;
223+
224+
println!("Waiting for ICE result...");
225+
tokio::time::sleep(std::time::Duration::from_secs(3)).await;
226+
}
227+
228+
ice_result
219229
.map_err(GsError::ApiError)
220230
}
221231

0 commit comments

Comments
 (0)