MCPcopy Create free account
hub / github.com/pion/ice / replaceRemoteInPairs

Method replaceRemoteInPairs

agent.go:1208–1223  ·  view source on GitHub ↗
(oldRemote, newRemote Candidate)

Source from the content-addressed store, hash-verified

1206}
1207
1208func (a *Agent) replaceRemoteInPairs(oldRemote, newRemote Candidate) {
1209 for i, pair := range a.checklist {
1210 if pair.Remote == oldRemote {
1211 oldPriority := pair.priority()
1212 replacement := replacePairRemote(pair, newRemote)
1213 replacement.setPriorityOverride(oldPriority)
1214 a.checklist[i] = replacement
1215 a.pairsByID[replacement.id] = replacement
1216 a.retargetKnownPairHolders(pair, replacement)
1217
1218 if a.getSelectedPair() == pair {
1219 a.setSelectedPair(replacement)
1220 }
1221 }
1222 }
1223}
1224
1225func (a *Agent) replaceRemoteInLocalCaches(oldRemote, newRemote Candidate) {
1226 for _, locals := range a.localCandidates {

Calls 6

getSelectedPairMethod · 0.95
setSelectedPairMethod · 0.95
replacePairRemoteFunction · 0.85
priorityMethod · 0.80
setPriorityOverrideMethod · 0.80

Tested by

no test coverage detected