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

CEDNeighbour Class Reference

#include <EDNeighbour.h>

Inheritance diagram for CEDNeighbour:

CNeighbour CConnection List of all members.

Public Member Functions

 CEDNeighbour ()
virtual ~CEDNeighbour ()
virtual BOOL ConnectTo (IN_ADDR *pAddress, WORD nPort, BOOL bAutomatic)
virtual BOOL Send (CPacket *pPacket, BOOL bRelease=TRUE, BOOL bBuffered=FALSE)
virtual BOOL SendQuery (CQuerySearch *pSearch, CPacket *pPacket, BOOL bLocal)
BOOL SendSharedDownload (CDownload *pDownload)

Public Attributes

DWORD m_nClientID
DWORD m_nUserCount
DWORD m_nUserLimit
DWORD m_nFileLimit
DWORD m_nTCPFlags
DWORD m_nUDPFlags
CString m_sServerName
CPtrList m_pQueries
DWORD m_nFilesSent

Protected Member Functions

virtual BOOL OnRun ()
virtual BOOL OnConnected ()
virtual void OnDropped (BOOL bError)
virtual BOOL OnRead ()
BOOL OnPacket (CEDPacket *pPacket)
BOOL OnRejected (CEDPacket *pPacket)
BOOL OnServerMessage (CEDPacket *pPacket)
BOOL OnIdChange (CEDPacket *pPacket)
BOOL OnServerList (CEDPacket *pPacket)
BOOL OnServerStatus (CEDPacket *pPacket)
BOOL OnServerIdent (CEDPacket *pPacket)
BOOL OnCallbackRequest (CEDPacket *pPacket)
BOOL OnSearchResults (CEDPacket *pPacket)
BOOL OnFoundSources (CEDPacket *pPacket)
void SendSharedFiles ()

Constructor & Destructor Documentation

CEDNeighbour::CEDNeighbour  ) 
 

Definition at line 57 of file EDNeighbour.cpp.

References m_nClientID, m_nFileLimit, m_nFilesSent, CNeighbour::m_nNodeType, m_nTCPFlags, m_nUDPFlags, m_nUserCount, m_nUserLimit, CNeighbour::m_pMoreResultsGUID, ntHub, and NULL.

CEDNeighbour::~CEDNeighbour  )  [virtual]
 

Definition at line 70 of file EDNeighbour.cpp.

References CNeighbour::m_pMoreResultsGUID, m_pQueries, and NULL.


Member Function Documentation

BOOL CEDNeighbour::ConnectTo IN_ADDR *  pAddress,
WORD  nPort,
BOOL  bAutomatic
[virtual]
 

Definition at line 83 of file EDNeighbour.cpp.

References CNeighboursBase::Add(), CConnection::ConnectTo(), IDS_CONNECTION_CONNECT_FAIL, IDS_ED2K_SERVER_CONNECTING, CNeighbour::m_bAutomatic, CConnection::m_hSocket, CNeighbour::m_nState, CConnection::m_pHost, CNetwork::m_pWakeup, CConnection::m_sAddress, CShareazaApp::Message(), MSG_DEFAULT, MSG_ERROR, Neighbours, Network, nrsConnecting, and theApp.

Referenced by CNeighboursWithConnect::ConnectTo().

BOOL CEDNeighbour::OnCallbackRequest CEDPacket pPacket  )  [protected]
 

Definition at line 507 of file EDNeighbour.cpp.

References EDClients, CNetwork::IsFirewalledAddress(), Network, and CEDClients::PushTo().

Referenced by OnPacket().

BOOL CEDNeighbour::OnConnected  )  [protected, virtual]
 

Reimplemented from CConnection.

Definition at line 171 of file EDNeighbour.cpp.

References ED2K_C2S_LOGINREQUEST, ED2K_COMPATIBLECLIENT_ID, ED2K_CT_FLAGS, ED2K_CT_NAME, ED2K_CT_PORT, ED2K_CT_SOFTWAREVERSION, ED2K_CT_VERSION, ED2K_SERVER_TCP_DEFLATE, ED2K_SERVER_TCP_SMALLTAGS, ED2K_SERVER_TCP_UNICODE, ED2K_VERSION, CGProfile::GetNick(), CGProfile::GUID, IDS_ED2K_SERVER_CONNECTED, m_nClientID, CNeighbour::m_nState, CShareazaApp::m_nVersion, CNetwork::m_pHost, CConnection::m_sAddress, CShareazaApp::Message(), MSG_DEFAULT, MyProfile, GGUID::n, Network, CEDPacket::New(), nrsHandshake1, Send(), theApp, CPacket::Write(), CPacket::WriteLongLE(), and CPacket::WriteShortLE().

void CEDNeighbour::OnDropped BOOL  bError  )  [protected, virtual]
 

Reimplemented from CNeighbour.

Definition at line 212 of file EDNeighbour.cpp.

References CConnection::Close(), HostCache, IDS_CONNECTION_DROPPED, IDS_CONNECTION_REFUSED, CNeighbour::m_nState, CConnection::m_pHost, nrsConnected, nrsConnecting, and CHostCache::OnFailure().

BOOL CEDNeighbour::OnFoundSources CEDPacket pPacket  )  [protected]
 

Definition at line 566 of file EDNeighbour.cpp.

References CStatistics::Current, CQueryHit::FromPacket(), IDS_PROTOCOL_BAD_HIT, CNeighbour::m_nDropCount, m_nTCPFlags, CConnection::m_pHost, CConnection::m_sAddress, CShareazaApp::Message(), MSG_ERROR, Network, NULL, CNetwork::OnQueryHits(), Statistics, and theApp.

Referenced by OnPacket().

BOOL CEDNeighbour::OnIdChange CEDPacket pPacket  )  [protected]
 

Definition at line 332 of file EDNeighbour.cpp.

References CHostCacheList::Add(), CConnection::Close(), CSettings::Connection, ED2K_C2S_GETSERVERLIST, ED2K_SERVER_TCP_DEFLATE, ED2K_SERVER_TCP_GETSOURCES2, ED2K_SERVER_TCP_SMALLTAGS, ED2K_SERVER_TCP_UNICODE, CHostCache::eDonkey, HostCache, IDS_ED2K_SERVER_IDCHANGE, IDS_ED2K_SERVER_ONLINE, IDS_ED2K_SERVER_REFUSED, CSettings::sConnection::InHost, CEDPacket::IsLowID(), m_nClientID, CNeighbour::m_nState, m_nTCPFlags, CNetwork::m_pHost, CConnection::m_pHost, CConnection::m_sAddress, CShareazaApp::Message(), MSG_DEBUG, MSG_DEFAULT, Network, CEDPacket::New(), nrsConnected, Send(), SendSharedFiles(), Settings, and theApp.

Referenced by OnPacket().

BOOL CEDNeighbour::OnPacket CEDPacket pPacket  )  [protected]
 

Definition at line 260 of file EDNeighbour.cpp.

References CStatistics::Current, ED2K_S2C_CALLBACKREQUESTED, ED2K_S2C_FOUNDSOURCES, ED2K_S2C_IDCHANGE, ED2K_S2C_REJECTED, ED2K_S2C_SEARCHRESULTS, ED2K_S2C_SERVERIDENT, ED2K_S2C_SERVERLIST, ED2K_S2C_SERVERMESSAGE, ED2K_S2C_SERVERSTATUS, CNeighbour::m_nInputCount, CNeighbour::m_tLastPacket, NULL, OnCallbackRequest(), OnFoundSources(), OnIdChange(), OnRejected(), OnSearchResults(), OnServerIdent(), OnServerList(), OnServerMessage(), OnServerStatus(), and Statistics.

Referenced by OnRead().

BOOL CEDNeighbour::OnRead  )  [protected, virtual]
 

Reimplemented from CNeighbour.

Definition at line 232 of file EDNeighbour.cpp.

References ED2K_PROTOCOL_EDONKEY, CConnection::m_pInput, CNeighbour::m_pZInput, OnPacket(), CNeighbour::OnRead(), CEDPacket::ReadBuffer(), and CPacket::Release().

BOOL CEDNeighbour::OnRejected CEDPacket pPacket  )  [protected]
 

Definition at line 302 of file EDNeighbour.cpp.

References CConnection::Close(), and IDS_ED2K_SERVER_REJECTED.

Referenced by OnPacket().

BOOL CEDNeighbour::OnRun  )  [protected, virtual]
 

Reimplemented from CNeighbour.

Definition at line 136 of file EDNeighbour.cpp.

References CConnection::Close(), CSettings::Connection, IDS_CONNECTION_TIMEOUT_CONNECT, IDS_CONNECTION_TIMEOUT_TRAFFIC, IDS_HANDSHAKE_TIMEOUT, m_nClientID, CNeighbour::m_nState, CConnection::m_tConnected, CNeighbour::m_tLastPacket, nrsConnected, Settings, CSettings::sConnection::TimeoutConnect, and CSettings::sConnection::TimeoutHandshake.

BOOL CEDNeighbour::OnSearchResults CEDPacket pPacket  )  [protected]
 

Definition at line 521 of file EDNeighbour.cpp.

References CStatistics::Current, ED2K_S2C_SEARCHRESULTS, CQueryHit::FromPacket(), IDS_PROTOCOL_BAD_HIT, CNeighbour::m_nDropCount, m_nTCPFlags, CConnection::m_pHost, CNeighbour::m_pMoreResultsGUID, m_pQueries, CConnection::m_sAddress, CShareazaApp::Message(), MSG_DEBUG, MSG_ERROR, Network, NULL, CNetwork::OnQueryHits(), Statistics, and theApp.

Referenced by OnPacket().

BOOL CEDNeighbour::OnServerIdent CEDPacket pPacket  )  [protected]
 

Definition at line 431 of file EDNeighbour.cpp.

References CHostCacheList::Add(), ED2K_SERVER_TCP_DEFLATE, ED2K_SERVER_TCP_GETSOURCES2, ED2K_SERVER_TCP_UNICODE, ED2K_SERVER_UDP_GETFILES, ED2K_SERVER_UDP_GETSOURCES, ED2K_SERVER_UDP_GETSOURCES2, ED2K_SERVER_UDP_UNICODE, ED2K_ST_DESCRIPTION, ED2K_ST_MAXUSERS, ED2K_ST_SERVERNAME, CHostCache::eDonkey, CPacket::GetRemaining(), HostCache, IDS_ED2K_SERVER_IDENT, CNeighbour::m_bGUID, CEDTag::m_nKey, m_nTCPFlags, m_nUserLimit, CEDTag::m_nValue, CNeighbour::m_pGUID, CConnection::m_pHost, CConnection::m_sAddress, m_sServerName, CConnection::m_sUserAgent, CEDTag::m_sValue, CShareazaApp::Message(), MSG_DEBUG, MSG_DEFAULT, CEDTag::Read(), CPacket::Read(), CPacket::ReadLongLE(), CPacket::ReadShortLE(), and theApp.

Referenced by OnPacket().

BOOL CEDNeighbour::OnServerList CEDPacket pPacket  )  [protected]
 

Definition at line 387 of file EDNeighbour.cpp.

References CHostCacheList::Add(), CHostCache::eDonkey, CSettings::eDonkey, HostCache, CSettings::seDonkey::LearnNewServers, CConnection::m_pHost, CConnection::m_sAddress, CShareazaApp::Message(), MSG_DEBUG, Settings, and theApp.

Referenced by OnPacket().

BOOL CEDNeighbour::OnServerMessage CEDPacket pPacket  )  [protected]
 

Definition at line 308 of file EDNeighbour.cpp.

References CPacket::GetRemaining(), IDS_ED2K_SERVER_MESSAGE, m_nTCPFlags, CConnection::m_sAddress, CShareazaApp::Message(), MSG_SYSTEM, CEDPacket::ReadEDString(), and theApp.

Referenced by OnPacket().

BOOL CEDNeighbour::OnServerStatus CEDPacket pPacket  )  [protected]
 

Definition at line 414 of file EDNeighbour.cpp.

References CHostCacheList::Add(), CHostCache::eDonkey, CPacket::GetRemaining(), HostCache, CNeighbour::m_nFileCount, m_nUserCount, CConnection::m_pHost, and CPacket::ReadLongLE().

Referenced by OnPacket().

BOOL CEDNeighbour::Send CPacket pPacket,
BOOL  bRelease = TRUE,
BOOL  bBuffered = FALSE
[virtual]
 

Reimplemented from CNeighbour.

Definition at line 110 of file EDNeighbour.cpp.

References CStatistics::Current, CNeighbour::m_nOutputCount, CNeighbour::m_nState, CConnection::m_pOutput, CNeighbour::m_pZOutput, nrsConnected, nrsHandshake1, NULL, PROTOCOL_ED2K, CConnection::QueueRun(), and Statistics.

Referenced by OnConnected(), OnIdChange(), CNeighboursWithED2K::PushDonkey(), SendQuery(), SendSharedDownload(), and SendSharedFiles().

BOOL CEDNeighbour::SendQuery CQuerySearch pSearch,
CPacket pPacket,
BOOL  bLocal
[virtual]
 

Reimplemented from CNeighbour.

Definition at line 872 of file EDNeighbour.cpp.

References CSettings::eDonkey, CQuerySearch::m_bED2K, CQuerySearch::m_bWantDN, m_nClientID, CPacket::m_nProtocol, CNeighbour::m_nState, CQuerySearch::m_pGUID, m_pQueries, CSettings::seDonkey::MagnetSearch, nrsConnected, NULL, PROTOCOL_ED2K, Send(), and Settings.

BOOL CEDNeighbour::SendSharedDownload CDownload pDownload  ) 
 

Definition at line 814 of file EDNeighbour.cpp.

References CEDPacket::Deflate(), ED2K_C2S_OFFERFILES, ED2K_FT_FILENAME, ED2K_FT_FILESIZE, ED2K_SERVER_TCP_DEFLATE, CEDPacket::IsLowID(), CDownloadBase::m_bED2K, m_nClientID, m_nFileLimit, m_nFilesSent, CDownloadBase::m_nSize, CNeighbour::m_nState, m_nTCPFlags, CDownloadBase::m_pED2K, CNetwork::m_pHost, CDownloadBase::m_sRemoteName, CDownloadWithTiger::NeedHashset(), Network, CEDPacket::New(), nrsConnected, Send(), SIZE_UNKNOWN, CPacket::Write(), CPacket::WriteLongLE(), and CPacket::WriteShortLE().

Referenced by CNeighboursWithED2K::SendDonkeyDownload().

void CEDNeighbour::SendSharedFiles  )  [protected]
 

Definition at line 596 of file EDNeighbour.cpp.

References CUploadQueues::CanUpload(), CEDPacket::Deflate(), Downloads, ED2K_C2S_OFFERFILES, ED2K_FT_BITRATE, ED2K_FT_CODEC, ED2K_FT_FILENAME, ED2K_FT_FILERATING, ED2K_FT_FILESIZE, ED2K_FT_FILETYPE, ED2K_FT_LENGTH, ED2K_SERVER_TCP_DEFLATE, ED2K_SERVER_TCP_SMALLTAGS, CHostCache::eDonkey, CSettings::eDonkey, CHostCacheList::Find(), CXMLElement::GetAttributeValue(), CLibraryMaps::GetFileIterator(), CDownloads::GetIterator(), CDownloads::GetNext(), CLibraryMaps::GetNextFile(), CLibraryFile::GetSize(), HostCache, CEDPacket::IsLowID(), CDownload::IsMoving(), CLibraryFile::IsSchemaURI(), CLibraryFile::IsShared(), CDownload::IsStarted(), Library, LibraryMaps, CLibraryFile::m_bED2K, CDownloadBase::m_bED2K, m_nClientID, CHostCacheHost::m_nFileLimit, m_nFileLimit, m_nFilesSent, CLibraryFile::m_nRating, CDownloadBase::m_nSize, m_nTCPFlags, CPacket::m_pBuffer, CLibraryFile::m_pED2K, CDownloadBase::m_pED2K, CNetwork::m_pHost, CConnection::m_pHost, CLibraryFile::m_pMetadata, CLibraryFile::m_pSchema, CLibrary::m_pSection, CTransfers::m_pSection, CSchema::m_sDonkeyType, CLibraryFile::m_sName, CDownloadBase::m_sRemoteName, CSettings::seDonkey::MaxShareCount, CSettings::seDonkey::MinServerFileSize, CDownloadWithTiger::NeedHashset(), Network, CEDPacket::New(), NULL, PROTOCOL_ED2K, Send(), Settings, SIZE_UNKNOWN, Transfers, UploadQueues, CSchema::uriAudio, CSchema::uriVideo, CPacket::Write(), CPacket::WriteLongLE(), and CPacket::WriteShortLE().

Referenced by OnIdChange().


Member Data Documentation

DWORD CEDNeighbour::m_nClientID
 

Definition at line 42 of file EDNeighbour.h.

Referenced by CEDNeighbour(), CNeighboursWithED2K::GetDonkeyServer(), OnConnected(), OnIdChange(), OnRun(), CRemote::PageNetworkNetwork(), CNeighboursWithED2K::PushDonkey(), CEDClient::SendHello(), SendQuery(), SendSharedDownload(), SendSharedFiles(), and CNeighboursWnd::Update().

DWORD CEDNeighbour::m_nFileLimit
 

Definition at line 45 of file EDNeighbour.h.

Referenced by CEDNeighbour(), SendSharedDownload(), and SendSharedFiles().

DWORD CEDNeighbour::m_nFilesSent
 

Definition at line 51 of file EDNeighbour.h.

Referenced by CEDNeighbour(), SendSharedDownload(), and SendSharedFiles().

DWORD CEDNeighbour::m_nTCPFlags
 

Definition at line 46 of file EDNeighbour.h.

Referenced by CEDNeighbour(), OnFoundSources(), OnIdChange(), OnSearchResults(), OnServerIdent(), OnServerMessage(), SendSharedDownload(), and SendSharedFiles().

DWORD CEDNeighbour::m_nUDPFlags
 

Definition at line 47 of file EDNeighbour.h.

Referenced by CEDNeighbour().

DWORD CEDNeighbour::m_nUserCount
 

Definition at line 43 of file EDNeighbour.h.

Referenced by CEDNeighbour(), OnServerStatus(), CRemote::PageNetworkNetwork(), and CNeighboursWnd::Update().

DWORD CEDNeighbour::m_nUserLimit
 

Definition at line 44 of file EDNeighbour.h.

Referenced by CEDNeighbour(), OnServerIdent(), CRemote::PageNetworkNetwork(), and CNeighboursWnd::Update().

CPtrList CEDNeighbour::m_pQueries
 

Definition at line 50 of file EDNeighbour.h.

Referenced by OnSearchResults(), SendQuery(), and ~CEDNeighbour().

CString CEDNeighbour::m_sServerName
 

Definition at line 48 of file EDNeighbour.h.

Referenced by OnServerIdent(), CRemote::PageNetworkNetwork(), and CNeighboursWnd::Update().


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