Skip to content

Commit 9d20fb3

Browse files
peer: use GatheringCompletePromise from Pion
This is just to test if the outcome of ICE negotiation changes. So far the connection does not get established despite an exchange of ICE candidates.
1 parent 6bcfad7 commit 9d20fb3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/peer/peer.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,16 @@ func (p *Peer[ID]) ProcessSDPOffer(sdpOffer string) (*webrtc.SessionDescription,
180180
return nil, ErrCantCreateAnswer
181181
}
182182

183+
// TODO: Do we really need to call `webrtc.GatheringCompletePromise` here?
184+
gatherComplete := webrtc.GatheringCompletePromise(p.peerConnection)
185+
183186
if err := p.peerConnection.SetLocalDescription(answer); err != nil {
184187
p.logger.WithError(err).Error("failed to set local description")
185188
return nil, ErrCantSetLocalDescription
186189
}
187190

188-
// TODO: Do we really need to call `webrtc.GatheringCompletePromise` here?
191+
// Block until ICE Gathering is complete.
192+
<-gatherComplete
189193

190194
sdpAnswer := p.peerConnection.LocalDescription()
191195
if sdpAnswer == nil {

0 commit comments

Comments
 (0)