Skip to content

Commit

Permalink
Add fallback for windows CI
Browse files Browse the repository at this point in the history
WIP
  • Loading branch information
iterion committed Feb 21, 2025
1 parent 0c06d8c commit 77cf058
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/lang/std/engineConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,17 +563,18 @@ class EngineConnection extends EventTarget {
this.disconnectAll()
}

initiateConnectionExclusive(): boolean {
initiateConnectionExclusive(ignoreIceGatheringState: boolean): boolean {
// Only run if:
// - A peer connection exists,
// - ICE gathering is complete,
// - We have an SDP answer,
// - And we haven’t already triggered this connection.
if (
!this.pc ||
this.pc.iceGatheringState !== 'complete' ||
this.triggeredStart ||
!this.sdpAnswer
!this.sdpAnswer ||
ignoreIceGatheringState ||
this.pc.iceGatheringState !== 'complete'
) {
return false
}
Expand Down Expand Up @@ -657,7 +658,7 @@ class EngineConnection extends EventTarget {
// This is null when the ICE gathering state is done.
// Windows ONLY uses this to signal it's done!
if (event.candidate === null) {
this.initiateConnectionExclusive()
this.initiateConnectionExclusive(false)
return
}

Expand All @@ -681,7 +682,7 @@ class EngineConnection extends EventTarget {
// Sometimes the remote end doesn't report the end of candidates.
// They have 3 seconds to.
setTimeout(() => {
if (this.initiateConnectionExclusive()) {
if (this.initiateConnectionExclusive(true)) {
console.warn('connected after 3 second delay')
}
}, 3000)
Expand All @@ -693,7 +694,7 @@ class EngineConnection extends EventTarget {
console.log('icegatheringstatechange', this.iceGatheringState)

if (this.iceGatheringState !== 'complete') return
that.initiateConnectionExclusive()
that.initiateConnectionExclusive(false)
}
)

Expand Down Expand Up @@ -1236,7 +1237,7 @@ class EngineConnection extends EventTarget {

// We might have received this after ice candidates finish
// Make sure we attempt to connect when we do.
this.initiateConnectionExclusive()
this.initiateConnectionExclusive(false)
break

case 'trickle_ice':
Expand Down

0 comments on commit 77cf058

Please sign in to comment.