Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

CNeighboursWithConnect Class Reference

#include <NeighboursWithConnect.h>

Inheritance diagram for CNeighboursWithConnect:

CNeighboursWithRouting CNeighboursWithED2K CNeighboursWithG2 CNeighboursWithG1 CNeighboursBase CNeighbours List of all members.

Public Member Functions

 CNeighboursWithConnect ()
virtual ~CNeighboursWithConnect ()
CNeighbourConnectTo (IN_ADDR *pAddress, WORD nPort, PROTOCOLID nProtocol, BOOL bAutomatic=FALSE, BOOL bNoUltraPeer=FALSE)
CNeighbourOnAccept (CConnection *pConnection)
BOOL IsG2Leaf ()
BOOL IsG2Hub ()
DWORD IsG2HubCapable (BOOL bDebug=FALSE)
BOOL IsG1Leaf ()
BOOL IsG1Ultrapeer ()
DWORD IsG1UltrapeerCapable (BOOL bDebug=FALSE)
BOOL NeedMoreHubs (PROTOCOLID nProtocol)
BOOL NeedMoreLeafs (PROTOCOLID nProtocol)
BOOL IsHubLoaded (PROTOCOLID nProtocol)
virtual void OnRun ()

Protected Member Functions

void Maintain ()
void PeerPrune (PROTOCOLID nProtocol)

Protected Attributes

BOOL m_bG2Leaf
BOOL m_bG2Hub
BOOL m_bG1Leaf
BOOL m_bG1Ultrapeer
DWORD m_tHubG2Promotion
DWORD m_tPresent [8]

Constructor & Destructor Documentation

CNeighboursWithConnect::CNeighboursWithConnect  ) 
 

Definition at line 46 of file NeighboursWithConnect.cpp.

References m_bG1Leaf, m_bG1Ultrapeer, m_bG2Hub, m_bG2Leaf, m_tHubG2Promotion, and m_tPresent.

CNeighboursWithConnect::~CNeighboursWithConnect  )  [virtual]
 

Definition at line 58 of file NeighboursWithConnect.cpp.


Member Function Documentation

CNeighbour * CNeighboursWithConnect::ConnectTo IN_ADDR *  pAddress,
WORD  nPort,
PROTOCOLID  nProtocol,
BOOL  bAutomatic = FALSE,
BOOL  bNoUltraPeer = FALSE
 

Definition at line 65 of file NeighboursWithConnect.cpp.

References CNeighboursBase::CEDNeighbour, CNeighboursWithED2K::CloseDonkeys(), CNetwork::Connect(), CShakeNeighbour::ConnectTo(), CEDNeighbour::ConnectTo(), CNeighboursBase::CShakeNeighbour, CSettings::eDonkey, CSettings::seDonkey::EnableToday, CSettings::sGnutella2::EnableToday, CSettings::sGnutella1::EnableToday, CNeighboursBase::Get(), CSettings::Gnutella, CSettings::Gnutella1, CSettings::Gnutella2, IDS_CONNECTION_ALREADY_ABORT, IDS_NETWORK_SECURITY_OUTGOING, CSecurity::IsDenied(), CNetwork::IsFirewalledAddress(), CNeighbour::m_nProtocol, CNetwork::m_pSection, CShareazaApp::Message(), MSG_ERROR, NeedMoreHubs(), Neighbours, Network, NULL, PROTOCOL_ED2K, PROTOCOL_G1, PROTOCOL_G2, Security, Settings, CSettings::sGnutella::SpecifyProtocol, and theApp.

Referenced by CHostCacheHost::ConnectTo(), and CNetwork::OnWinsock().

BOOL CNeighboursWithConnect::IsG1Leaf  ) 
 

Definition at line 447 of file NeighboursWithConnect.cpp.

References CNetwork::m_bEnabled, m_bG1Leaf, and Network.

Referenced by IsG1UltrapeerCapable(), NeedMoreHubs(), CShakeNeighbour::OnHeadersCompleteG1(), and CG1Neighbour::OnPing().

BOOL CNeighboursWithConnect::IsG1Ultrapeer  ) 
 

Definition at line 453 of file NeighboursWithConnect.cpp.

References CNetwork::m_bEnabled, m_bG1Ultrapeer, and Network.

Referenced by CShakeNeighbour::OnHeadersCompleteG1(), CShakeNeighbour::SendPublicHeaders(), CStatistics::Update(), CDiscoveryServices::Update(), and CMainWnd::UpdateMessages().

DWORD CNeighboursWithConnect::IsG1UltrapeerCapable BOOL  bDebug = FALSE  ) 
 

Definition at line 459 of file NeighboursWithConnect.cpp.

References CSettings::sBitTorrent::AdvancedInterface, CSettings::sScheduler::AllowHub, CSettings::Bandwidth, CSettings::BitTorrent, CSettings::sGnutella1::ClientMode, CSettings::Connection, Datagrams, CSettings::eDonkey, CSettings::sScheduler::Enable, CSettings::sGnutella2::EnableToday, CSettings::seDonkey::EnableToday, CSettings::sGnutella1::EnableToday, CNetwork::GetStableTime(), CSettings::Gnutella1, CSettings::Gnutella2, CSettings::sConnection::InSpeed, IsG1Leaf(), IsG2Hub(), CDatagrams::IsStable(), CShareazaApp::m_bNT, CShareazaApp::m_nPhysicalMemory, CShareazaApp::Message(), MODE_LEAF, MODE_ULTRAPEER, MSG_DEBUG, Network, CSettings::sGnutella1::NumLeafs, CSettings::sGnutella1::NumPeers, CSettings::sConnection::OutSpeed, CSettings::Scheduler, Settings, theApp, and CSettings::sBandwidth::Uploads.

Referenced by CSystemWnd::OnCreate(), CShakeNeighbour::OnHeadersCompleteG1(), CMainWnd::OnHelpAbout(), and CShakeNeighbour::SendPublicHeaders().

BOOL CNeighboursWithConnect::IsG2Hub  ) 
 

Definition at line 205 of file NeighboursWithConnect.cpp.

References CNetwork::m_bEnabled, m_bG2Hub, and Network.

Referenced by IsG1UltrapeerCapable(), CDatagrams::OnCrawlRequest(), CShakeNeighbour::OnHeadersCompleteG2(), CDatagrams::OnQueryKeyRequest(), CShakeNeighbour::SendPublicHeaders(), CStatistics::Update(), CDiscoveryServices::Update(), and CMainWnd::UpdateMessages().

DWORD CNeighboursWithConnect::IsG2HubCapable BOOL  bDebug = FALSE  ) 
 

Definition at line 211 of file NeighboursWithConnect.cpp.

References CSettings::sBitTorrent::AdvancedInterfaceSet, CSettings::sScheduler::AllowHub, CSettings::BitTorrent, CSettings::sGnutella2::ClientMode, CSettings::Connection, Datagrams, CSettings::eDonkey, CSettings::sScheduler::Enable, CSettings::sGnutella1::EnableToday, CSettings::seDonkey::EnableToday, CSettings::sGnutella2::EnableToday, CNetwork::GetStableTime(), CSettings::Gnutella1, CSettings::Gnutella2, CSettings::sGnutella2::HubVerified, CSettings::sConnection::InSpeed, IsG2Leaf(), CDatagrams::IsStable(), CShareazaApp::m_bNT, CShareazaApp::m_nPhysicalMemory, CShareazaApp::Message(), MODE_HUB, MODE_LEAF, MSG_DEBUG, Network, CSettings::sGnutella2::NumLeafs, CSettings::sGnutella2::NumPeers, CSettings::sConnection::OutSpeed, CSettings::Scheduler, Settings, and theApp.

Referenced by CDatagrams::OnCrawlRequest(), CSystemWnd::OnCreate(), CShakeNeighbour::OnHeadersCompleteG2(), CMainWnd::OnHelpAbout(), and CShakeNeighbour::SendPublicHeaders().

BOOL CNeighboursWithConnect::IsG2Leaf  ) 
 

Definition at line 199 of file NeighboursWithConnect.cpp.

References CNetwork::m_bEnabled, m_bG2Leaf, and Network.

Referenced by CShakeNeighbour::CShakeNeighbour(), IsG2HubCapable(), NeedMoreHubs(), CDatagrams::OnCrawlRequest(), CShakeNeighbour::OnHeadersCompleteG2(), CG2Neighbour::SendHAW(), and CG2Neighbour::SendLNI().

BOOL CNeighboursWithConnect::IsHubLoaded PROTOCOLID  nProtocol  ) 
 

Definition at line 761 of file NeighboursWithConnect.cpp.

References CSettings::sGnutella2::EnableToday, CSettings::sGnutella1::EnableToday, CNeighboursBase::GetIterator(), CNeighboursBase::GetNext(), CSettings::Gnutella1, CSettings::Gnutella2, CNeighbour::m_nNodeType, CNeighbour::m_nProtocol, CNeighbour::m_nState, nrsConnected, ntLeaf, CSettings::sGnutella2::NumLeafs, CSettings::sGnutella1::NumLeafs, PROTOCOL_G1, PROTOCOL_G2, PROTOCOL_NULL, and Settings.

void CNeighboursWithConnect::Maintain  )  [protected]
 

Definition at line 812 of file NeighboursWithConnect.cpp.

References CNeighbour::Close(), CSettings::sGnutella::ConnectFactor, CSettings::Connection, CSettings::sConnection::ConnectThrottle, DiscoveryServices, Downloads, CSettings::Downloads, CSettings::eDonkey, CSettings::seDonkey::EnableToday, CSettings::sGnutella2::EnableToday, CSettings::sGnutella1::EnableToday, CDiscoveryServices::Execute(), CSettings::seDonkey::FastConnect, CHostCache::ForProtocol(), CNeighboursBase::GetIterator(), CHostCacheList::GetNewest(), CNeighboursBase::GetNext(), CHostCacheList::GetOldest(), CSettings::Gnutella, CSettings::Gnutella1, CSettings::Gnutella2, HostCache, CSettings::sGnutella2::HubVerified, IDS_CONNECTION_PEERPRUNE, CNetwork::m_bAutoConnect, CNeighbour::m_bAutomatic, CNetwork::m_bEnabled, m_bG1Leaf, m_bG1Ultrapeer, m_bG2Hub, m_bG2Leaf, CConnection::m_bInitiated, CNeighbour::m_nNodeType, CNeighbour::m_nProtocol, CNeighbour::m_nState, CConnection::m_tConnected, m_tHubG2Promotion, CDownloads::m_tLastConnect, CNetwork::m_tLastConnect, m_tPresent, CSettings::sDownloads::MaxConnectingSources, Network, nrsConnected, ntHub, ntLeaf, NULL, CSettings::sGnutella2::NumHubs, CSettings::sGnutella1::NumHubs, CSettings::sGnutella1::NumLeafs, CSettings::sGnutella2::NumLeafs, CSettings::sGnutella2::NumPeers, CSettings::sGnutella1::NumPeers, CSettings::seDonkey::NumServers, PROTOCOL_ED2K, PROTOCOL_G1, PROTOCOL_G2, PROTOCOL_NULL, CNetwork::ReadyToTransfer(), and Settings.

Referenced by OnRun().

BOOL CNeighboursWithConnect::NeedMoreHubs PROTOCOLID  nProtocol  ) 
 

Definition at line 695 of file NeighboursWithConnect.cpp.

References CSettings::sGnutella2::EnableToday, CSettings::sGnutella1::EnableToday, CNeighboursBase::GetIterator(), CNeighboursBase::GetNext(), CSettings::Gnutella1, CSettings::Gnutella2, CNetwork::IsConnected(), IsG1Leaf(), IsG2Leaf(), CNeighbour::m_nNodeType, CNeighbour::m_nProtocol, CNeighbour::m_nState, Network, nrsConnected, ntLeaf, CSettings::sGnutella2::NumHubs, CSettings::sGnutella1::NumHubs, CSettings::sGnutella2::NumPeers, CSettings::sGnutella1::NumPeers, PROTOCOL_G1, PROTOCOL_G2, PROTOCOL_NULL, and Settings.

Referenced by ConnectTo(), CDiscoveryServices::Execute(), CShakeNeighbour::OnHeadersCompleteG1(), CShakeNeighbour::OnHeadersCompleteG2(), PeerPrune(), and CG1Neighbour::SendPing().

BOOL CNeighboursWithConnect::NeedMoreLeafs PROTOCOLID  nProtocol  ) 
 

Definition at line 728 of file NeighboursWithConnect.cpp.

References CSettings::sGnutella2::EnableToday, CSettings::sGnutella1::EnableToday, CNeighboursBase::GetIterator(), CNeighboursBase::GetNext(), CSettings::Gnutella1, CSettings::Gnutella2, CNetwork::IsConnected(), CNeighbour::m_nNodeType, CNeighbour::m_nProtocol, CNeighbour::m_nState, Network, nrsConnected, ntLeaf, CSettings::sGnutella2::NumLeafs, CSettings::sGnutella1::NumLeafs, PROTOCOL_G1, PROTOCOL_G2, PROTOCOL_NULL, and Settings.

Referenced by CShakeNeighbour::OnHeadersCompleteG1(), CShakeNeighbour::OnHeadersCompleteG2(), and CG1Neighbour::SendPing().

CNeighbour * CNeighboursWithConnect::OnAccept CConnection pConnection  ) 
 

Definition at line 139 of file NeighboursWithConnect.cpp.

References CShakeNeighbour::AttachTo(), CNeighboursBase::CShakeNeighbour, CNetwork::m_pSection, Network, and NULL.

Referenced by CHandshake::OnRead().

void CNeighboursWithConnect::OnRun  )  [virtual]
 

Reimplemented from CNeighboursBase.

Reimplemented in CNeighbours.

Definition at line 794 of file NeighboursWithConnect.cpp.

References CNetwork::m_bAutoConnect, CNetwork::m_bEnabled, CNetwork::m_pSection, Maintain(), Network, and CNeighboursBase::OnRun().

Referenced by CNeighbours::OnRun().

void CNeighboursWithConnect::PeerPrune PROTOCOLID  nProtocol  )  [protected]
 

Definition at line 153 of file NeighboursWithConnect.cpp.

References CNeighbour::Close(), CNeighboursBase::GetIterator(), CNeighboursBase::GetNext(), IDS_CONNECTION_PEERPRUNE, CConnection::m_bInitiated, CNeighbour::m_nNodeType, CNeighbour::m_nProtocol, CNeighbour::m_nState, NeedMoreHubs(), nrsConnected, ntHub, and PROTOCOL_NULL.

Referenced by CShakeNeighbour::OnHandshakeComplete().


Member Data Documentation

BOOL CNeighboursWithConnect::m_bG1Leaf [protected]
 

Definition at line 59 of file NeighboursWithConnect.h.

Referenced by CNeighboursWithConnect(), IsG1Leaf(), and Maintain().

BOOL CNeighboursWithConnect::m_bG1Ultrapeer [protected]
 

Definition at line 60 of file NeighboursWithConnect.h.

Referenced by CNeighboursWithConnect(), IsG1Ultrapeer(), and Maintain().

BOOL CNeighboursWithConnect::m_bG2Hub [protected]
 

Definition at line 58 of file NeighboursWithConnect.h.

Referenced by CNeighboursWithConnect(), IsG2Hub(), and Maintain().

BOOL CNeighboursWithConnect::m_bG2Leaf [protected]
 

Definition at line 57 of file NeighboursWithConnect.h.

Referenced by CNeighboursWithConnect(), IsG2Leaf(), and Maintain().

DWORD CNeighboursWithConnect::m_tHubG2Promotion [protected]
 

Definition at line 62 of file NeighboursWithConnect.h.

Referenced by CNeighboursWithConnect(), and Maintain().

DWORD CNeighboursWithConnect::m_tPresent[8] [protected]
 

Definition at line 71 of file NeighboursWithConnect.h.

Referenced by CNeighboursWithConnect(), and Maintain().


The documentation for this class was generated from the following files:
Generated on Thu Dec 15 10:40:10 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2