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

CHandshakes Class Reference

#include <Handshakes.h>

List of all members.

Public Member Functions

 CHandshakes ()
virtual ~CHandshakes ()
BOOL Listen ()
void Disconnect ()
BOOL PushTo (IN_ADDR *pAddress, WORD nPort, DWORD nIndex=0)
BOOL IsConnectedTo (IN_ADDR *pAddress)
POSITION GetIterator () const
CHandshakeGetNext (POSITION &pos) const
BOOL IsListening () const

Public Attributes

DWORD m_nStableCount
DWORD m_tStableTime

Protected Member Functions

void Substitute (CHandshake *pOld, CHandshake *pNew)
void Remove (CHandshake *pHandshake)
void OnRun ()
void RunHandshakes ()
BOOL AcceptConnection ()
void CreateHandshake (SOCKET hSocket, SOCKADDR_IN *pHost)
void RunStableUpdate ()

Static Protected Member Functions

static UINT ThreadStart (LPVOID pParam)
static int CALLBACK AcceptCheck (IN LPWSABUF lpCallerId, IN LPWSABUF lpCallerData, IN OUT LPQOS lpSQOS, IN OUT LPQOS lpGQOS, IN LPWSABUF lpCalleeId, OUT LPWSABUF lpCalleeData, OUT GROUP FAR *g, IN DWORD dwCallbackData)

Protected Attributes

SOCKET m_hSocket
HANDLE m_hThread
CEvent m_pWakeup
CPtrList m_pList
CCriticalSection m_pSection

Friends

class CHandshake


Constructor & Destructor Documentation

CHandshakes::CHandshakes  ) 
 

Definition at line 53 of file Handshakes.cpp.

References m_hSocket, m_hThread, m_nStableCount, m_tStableTime, and NULL.

CHandshakes::~CHandshakes  )  [virtual]
 

Definition at line 65 of file Handshakes.cpp.

References Disconnect(), m_hSocket, m_hThread, and NULL.


Member Function Documentation

int CALLBACK CHandshakes::AcceptCheck IN LPWSABUF  lpCallerId,
IN LPWSABUF  lpCallerData,
IN OUT LPQOS  lpSQOS,
IN OUT LPQOS  lpGQOS,
IN LPWSABUF  lpCalleeId,
OUT LPWSABUF  lpCalleeData,
OUT GROUP FAR *  g,
IN DWORD  dwCallbackData
[static, protected]
 

Definition at line 466 of file Handshakes.cpp.

References IDS_NETWORK_SECURITY_DENIED, CSecurity::IsDenied(), CShareazaApp::Message(), MSG_ERROR, NULL, Security, and theApp.

Referenced by AcceptConnection().

BOOL CHandshakes::AcceptConnection  )  [protected]
 

Definition at line 404 of file Handshakes.cpp.

References AcceptCheck(), CreateHandshake(), IDS_NETWORK_SECURITY_DENIED, CSecurity::IsDenied(), m_hSocket, m_nStableCount, CShareazaApp::Message(), MSG_ERROR, Security, and theApp.

Referenced by OnRun().

void CHandshakes::CreateHandshake SOCKET  hSocket,
SOCKADDR_IN *  pHost
[protected]
 

Definition at line 445 of file Handshakes.cpp.

References CHandshake, m_pList, m_pSection, and m_pWakeup.

Referenced by AcceptConnection().

void CHandshakes::Disconnect  ) 
 

Definition at line 172 of file Handshakes.cpp.

References GetIterator(), GetNext(), m_hSocket, m_hThread, m_nStableCount, m_pList, m_pSection, m_pWakeup, m_tStableTime, CShareazaApp::Message(), MSG_DEBUG, NULL, and theApp.

Referenced by CNetwork::Disconnect(), and ~CHandshakes().

POSITION CHandshakes::GetIterator  )  const [inline]
 

Definition at line 93 of file Handshakes.h.

References m_pList.

Referenced by Disconnect(), IsConnectedTo(), and RunHandshakes().

CHandshake* CHandshakes::GetNext POSITION &  pos  )  const [inline]
 

Definition at line 100 of file Handshakes.h.

References m_pList.

Referenced by Disconnect(), IsConnectedTo(), and RunHandshakes().

BOOL CHandshakes::IsConnectedTo IN_ADDR *  pAddress  ) 
 

Definition at line 278 of file Handshakes.cpp.

References GetIterator(), GetNext(), CConnection::m_pHost, and m_pSection.

Referenced by CNetwork::IsConnectedTo().

BOOL CHandshakes::IsListening  )  const [inline]
 

Definition at line 107 of file Handshakes.h.

References m_hSocket.

Referenced by CNetwork::IsListening(), and CRemoteSettingsPage::OnBnClickedRemoteEnable().

BOOL CHandshakes::Listen  ) 
 

Definition at line 80 of file Handshakes.cpp.

References CSettings::Connection, IDS_NETWORK_CANT_LISTEN, IDS_NETWORK_LISTENING_TCP, CSettings::sConnection::InBind, m_hSocket, m_hThread, CNetwork::m_pHost, m_pSection, m_pWakeup, CShareazaApp::Message(), MSG_DEFAULT, MSG_ERROR, Network, CNetwork::RandomPort(), Settings, theApp, and ThreadStart().

Referenced by CNetwork::Connect().

void CHandshakes::OnRun  )  [protected]
 

Definition at line 346 of file Handshakes.cpp.

References AcceptConnection(), m_hSocket, m_pWakeup, RunHandshakes(), and RunStableUpdate().

BOOL CHandshakes::PushTo IN_ADDR *  pAddress,
WORD  nPort,
DWORD  nIndex = 0
 

Definition at line 234 of file Handshakes.cpp.

References CUploads::AllowMoreTo(), CHandshake, IDS_UPLOAD_PUSH_BUSY, m_pList, m_pSection, CTransfers::m_pSection, CShareazaApp::Message(), MSG_ERROR, CHandshake::Push(), theApp, Transfers, and Uploads.

Referenced by CG2Neighbour::OnPush(), CG1Neighbour::OnPush(), and CDatagrams::OnPush().

void CHandshakes::Remove CHandshake pHandshake  )  [protected]
 

Definition at line 317 of file Handshakes.cpp.

References m_pList, and NULL.

void CHandshakes::RunHandshakes  )  [protected]
 

Definition at line 372 of file Handshakes.cpp.

References CConnection::DoRun(), GetIterator(), GetNext(), m_pList, and m_pSection.

Referenced by OnRun().

void CHandshakes::RunStableUpdate  )  [protected]
 

Definition at line 494 of file Handshakes.cpp.

References DiscoveryServices, m_nStableCount, m_tStableTime, NULL, and CDiscoveryServices::Update().

Referenced by OnRun().

void CHandshakes::Substitute CHandshake pOld,
CHandshake pNew
[protected]
 

Definition at line 302 of file Handshakes.cpp.

References m_pList, and NULL.

UINT CHandshakes::ThreadStart LPVOID  pParam  )  [static, protected]
 

Definition at line 335 of file Handshakes.cpp.

Referenced by Listen().


Friends And Related Function Documentation

friend class CHandshake [friend]
 

Definition at line 114 of file Handshakes.h.

Referenced by CreateHandshake(), and PushTo().


Member Data Documentation

SOCKET CHandshakes::m_hSocket [protected]
 

Definition at line 53 of file Handshakes.h.

Referenced by AcceptConnection(), CHandshakes(), Disconnect(), IsListening(), Listen(), OnRun(), and ~CHandshakes().

HANDLE CHandshakes::m_hThread [protected]
 

Definition at line 54 of file Handshakes.h.

Referenced by CHandshakes(), Disconnect(), Listen(), and ~CHandshakes().

DWORD CHandshakes::m_nStableCount
 

Definition at line 47 of file Handshakes.h.

Referenced by AcceptConnection(), CHandshakes(), Disconnect(), CNetwork::IsStable(), and RunStableUpdate().

CPtrList CHandshakes::m_pList [protected]
 

Definition at line 58 of file Handshakes.h.

Referenced by CreateHandshake(), Disconnect(), GetIterator(), GetNext(), PushTo(), Remove(), RunHandshakes(), and Substitute().

CCriticalSection CHandshakes::m_pSection [protected]
 

Definition at line 59 of file Handshakes.h.

Referenced by CreateHandshake(), Disconnect(), IsConnectedTo(), Listen(), PushTo(), and RunHandshakes().

CEvent CHandshakes::m_pWakeup [protected]
 

Definition at line 55 of file Handshakes.h.

Referenced by CreateHandshake(), Disconnect(), Listen(), OnRun(), and CHandshake::Push().

DWORD CHandshakes::m_tStableTime
 

Definition at line 48 of file Handshakes.h.

Referenced by CHandshakes(), Disconnect(), CNetwork::GetStableTime(), and RunStableUpdate().


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