Source File
gathering_complete_promise.go
Belonging Package
github.com/pion/webrtc/v4
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage webrtcimport ()// GatheringCompletePromise is a Pion specific helper function that returns a channel that is closed// when gathering is complete.// This function may be helpful in cases where you are unable to trickle your ICE Candidates.//// It is better to not use this function, and instead trickle candidates.// If you use this function you will see longer connection startup times.// When the call is connected you will see no impact however.func ( *PeerConnection) ( <-chan struct{}) {, := context.WithCancel(context.Background())// It's possible to miss the GatherComplete event since setGatherCompleteHandler is an atomic operation and the// promise might have been created after the gathering is finished. Therefore, we need to check if the ICE gathering// state has changed to complete so that we don't block the caller forever..setGatherCompleteHandler(func() { () })if .ICEGatheringState() == ICEGatheringStateComplete {()}return .Done()}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |