Skip to content

Instantly share code, notes, and snippets.

@Sean-Der
Created August 2, 2019 00:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sean-Der/8677b050486699db61cce8d096dad887 to your computer and use it in GitHub Desktop.
Save Sean-Der/8677b050486699db61cce8d096dad887 to your computer and use it in GitHub Desktop.
diff --git a/agent.go b/agent.go
index a36423e..bd2c60d 100644
--- a/agent.go
+++ b/agent.go
@@ -596,6 +596,8 @@ func (a *Agent) taskLoop() {
}
} else {
select {
+ case <-a.forceCandidateContact:
+ a.selector.ContactCandidates()
case t := <-a.taskChan:
// Run the task
t(a)
@@ -709,6 +711,10 @@ func (a *Agent) addRemoteCandidate(c Candidate) {
a.addPair(localCandidate, c)
}
}
+
+ if a.trickle {
+ a.forceCandidateContact <- true
+ }
}
// addCandidate assumes you are holding the lock (must be execute using a.run)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment