Domanda

In a bittorrent client the first response from the tracker will contain a list of peers. When the tracker is contacted for an update after the first response, will any of the peers sent in the second response be the same as in the first response?

The reason I ask is that I don't want to waste time checking whether any of the peers in the new list are the same as the new list.

Thanks in advance

È stato utile?

Soluzione

Trackers generally should send a randomly selected subset of all peers they know for that swarm. Actual implementations differ, e.g. they might move a window over a long list of peers for efficiency reasons or they might inject fake peers to provide plausible deniability.

If the swarm size is low enough to fit into the numwant limit then they'll return the entire swarm.

But even if you get the entire swarm the set of returned peers still may differ simply due to new arrivals/departures.

And you also want to contact the tracker to keep yourself in their list, as you entry will expire eventually.

Long story short: There may be anywhere between 0 and 100% overlap between the returned sets.

Simply store your stuff in hash/set data structures and you'll be fine.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top