Developers.Code.CNeighboursWithG1

From Shareaza Wiki
Revision as of 18:16, 31 December 2007 by Dirtycat (talk | contribs) (Importing page from Tikiwiki)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

CNeighboursWithG1

After defining the list of neighbours in CNeighboursBase, the first inheriting class adds the ping and pong route caches. On the Gnutella network, ping and pong packets keep connections alive, communicate basic information about hosts, and are somtimes used for custom advanced purposes. Here are the parts of the Shareaza code I've seen so far that deal with them:

  • CRouteCache is the ping route cache (whatever that is)
  • CPongCache is the pong cache (again, I haven't gotten into that file yet)
  • CNeighboursWithG1 adds CRouteCache and CPongCache objects to CNeighbours
  • CG1Neighbour::OnPing is the only place that calls Neighbours.OnG1Ping()
  • CG1Neighbour::OnPong is the only place that calls Neighbours.OnG1Pong()
  • CNeighboursWithG1::OnG1Pong is the only place that calls CG1Neighbour::OnNewPong()

I need to document this part of the code by doing the following:

  1. Understand the format and meaning of ping and pong packets
  2. Understand how Gnutella clients exchange and route them on the network
  3. Comment and document CRouteCache and CPongCache
  4. Document how ping and pong packets flow through the Shareaza source code, telling the narrative from their perspective, irregardless of what classes and methods they cross through