Developers.FiguringOutCNeighbours: Difference between revisions

From Shareaza Wiki
Jump to navigation Jump to search
(Importing page from Tikiwiki)
 
m (1 revision)

Revision as of 20:09, 20 June 2009

Figuring out CNeighbours

The next classes I'm going to explore are part of a daunting column of inheritance:

File:With.gif

The classes are:

Developers.Code.CNeighboursBase Developers.Code.CNeighboursWithG1 Developers.Code.CNeighboursWithG2 Developers.Code.CNeighboursWithED2K Developers.Code.CNeighboursWithRouting Developers.Code.CNeighboursWithConnect Developers.Code.CNeighbours

Developer ten9 has said that Shareaza never makes an object from CNeighboursWithG1 or CNeighboursWithRouting. The inheritance column is just about building up features and functionality for CNeighbours, from which objects are made. It's weird that Gnutella, Gnutella2, and eDonkey2000 are all in the chain. I think that Mike also has questioned this design.

Here's my initial survey of these classes:

CNeighboursBase short member variables like m_nLeafCount and m_nBandwidthIn methods like Connect, Close, OnRun, Add and Remove seems to be keeping a list of computers we are connected to

CNeighboursWithG1 very short adds member variables like m_pPongCache adds methods like OnG1Ping and OnG1Pong seems to be searching the list of connected computers to deal with Gnutella ping and pong packets

CNeighboursWithG2 short doesn't add any member variables adds methods like CreateQueryWeb and GetRandomHub seems to be searching the list of connected computers to deal with Gnutella 2 packets

CNeighboursWithED2K very short adds member variables like m_tEDSources adds methods like SendDonkeyDownload and PushDonkey seems to be searching the connected computer list, and then doing a task with the found computer

CNeighboursWithRouting short doesn't add any member variables adds just two methods, Broadcast and RouteQuery this must be where the program does packet routing

CNeighboursWithConnect long doesn't add any member variables adds methods like IsG1Leaf and IsG1UltrapeerCapable lots of code about hubs and leaves

CNeighbours very short doesn't add any member variables defines virtual methods like Connect, Close and OnRun almost no code here, this seems to just be about how the inheritance works