Developers.Gnutella.Notes.Bootstrapping

From Shareaza Wiki
Jump to navigation Jump to search

Bootstrapping

This could really be called Connecting.


To connect to the Gnutella network, a servent needs to find and store hosts' addresses. There are four ways by which a servent may get hosts' addresses

And they are:

  1. Calling a GWebCache. This is a php script that someone has uploaded to their Web server. Gnutella programs running on personal computers call the script to tell it their IP address, and get the IP addresses of programs that have done the same thing recently. This lets Gnutella programs find each other.
  2. During the handshake, Gnutella programs tell each other some more IP addresses in X-Try and X-Try-Ultrapeers headers.
  3. There are addresses sprinkled into Pong messages the same way.
  4. QueryHit messages also have IP addresses in them.

Shareaza keeps a host cache - a part of the program that lists IP addresses on the Internet where Gnutella programs may be running and reachable now. When it queries a GWebCache, reads an X-Try header, or looks in a Pong or QueryHit message, it pulls out the addresses and hands them over to the host cache.