return
}
+// Actively prunes unused connections. This is required to make space to dial
+// for replacements.
func (cl *Client) connectionPruner(t *torrent) {
for {
time.Sleep(15 * time.Second)
package dht
+// get_peers and announce_peers.
+
import (
"log"
"time"
go func() {
select {
case m := <-t.Response:
+ // Register suggested nodes closer to the target info-hash.
me.mu.Lock()
for _, n := range m.Nodes() {
me.responseNode(n)
NodeInfo // The node that gave the response.
}
+// TODO: This was to be the shared publicly accessible part returned by DHT
+// functions that stream peers. Possibly not necessary anymore.
type peerStream struct {
mu sync.Mutex
Values chan peerStreamValue