Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,13 +504,14 @@ func (a *Agent) setSelectedPair(pair *CandidatePair) {
a.selectedPair.Store(pair)
a.log.Tracef("Set selected candidate pair: %s", pair)

// Signal connected: notify any Connect() calls waiting on onConnected
a.onConnectedOnce.Do(func() { close(a.onConnected) })

// Update connection state to Connected and notify state change handlers
a.updateConnectionState(ConnectionStateConnected)

// Notify when the selected pair changes
// Notify when the selected candidate pair changes
a.selectedCandidatePairNotifier.EnqueueSelectedCandidatePair(pair)

// Signal connected
a.onConnectedOnce.Do(func() { close(a.onConnected) })
}

func (a *Agent) pingAllCandidates() {
Expand Down
Loading