diff --git a/agent.go b/agent.go index c7f5037..5f1e91b 100644 --- a/agent.go +++ b/agent.go @@ -457,6 +457,7 @@ func (a *Agent) setSelectedPair(p *candidatePair) { a.onSelectedCandidatePairChange(p) a.selectedPair = p + a.selectedPair.nominated = true a.updateConnectionState(ConnectionStateConnected) // Close mDNS Conn. We don't need to do anymore querying @@ -993,7 +994,7 @@ func (a *Agent) GetCandidatePairsStats() []CandidatePairStats { LocalCandidateID: cp.local.ID(), RemoteCandidateID: cp.remote.ID(), State: cp.state, - // Nominated bool + Nominated: cp.nominated, // PacketsSent uint32 // PacketsReceived uint32 // BytesSent uint64 diff --git a/candidatepair.go b/candidatepair.go index c95b8d4..00f904e 100644 --- a/candidatepair.go +++ b/candidatepair.go @@ -22,6 +22,7 @@ type candidatePair struct { local Candidate bindingRequestCount uint16 state CandidatePairState + nominated bool } func (p *candidatePair) String() string { diff --git a/selection.go b/selection.go index 71277e9..8560a8e 100644 --- a/selection.go +++ b/selection.go @@ -82,6 +82,7 @@ func (s *controllingSelector) ContactCandidates() { p := s.agent.getBestValidCandidatePair() if p != nil && s.isNominatable(p.local) && s.isNominatable(p.remote) { s.log.Tracef("Nominatable pair found, nominating (%s, %s)", p.local.String(), p.remote.String()) + p.nominated = true s.nominatedPair = p s.nominatePair(p) return