Quote:
Originally Posted by hustnn But I don't mean how to choose the node to connect from the host lists.I mean when we collect hosts from udp host cache,x-try,x-ultrapeer,pong or query hits ways,then they contruct the local host cache list,then we how to maintain it,such as
"how to check th host in the list is still active?",
"how ofter to check?",
"when do I need to collect new hosts to update the local cache?" |
You'll get so mand new hosts via pongs that you won't need to ask them if they are still alive. You just keep statistics of what you naturally see.
And that's what the code I linked to in phex does: it sorts the newcoming hosts, and phex then just keeps the top 1000 addresses.
That means, you have to sort every host into your local hostcatcher and let the worst ones drop out.