#include <BTClient.h>
Inheritance diagram for CBTClient:
Public Member Functions | |
CBTClient () | |
virtual | ~CBTClient () |
virtual BOOL | Connect (CDownloadTransferBT *pDownloadTransfer) |
virtual void | AttachTo (CConnection *pConnection) |
virtual void | Close () |
void | Send (CBTPacket *pPacket, BOOL bRelease=TRUE) |
BOOL | IsOnline () const |
Public Attributes | |
SHA1 | m_pGUID |
BOOL | m_bExtended |
BOOL | m_bExchange |
CUploadTransferBT * | m_pUpload |
CDownload * | m_pDownload |
CDownloadTransferBT * | m_pDownloadTransfer |
Protected Member Functions | |
virtual BOOL | OnRun () |
virtual BOOL | OnConnected () |
virtual void | OnDropped (BOOL bError) |
virtual BOOL | OnWrite () |
virtual BOOL | OnRead () |
void | SendHandshake (BOOL bPart1, BOOL bPart2) |
BOOL | OnHandshake1 () |
BOOL | OnHandshake2 () |
BOOL | OnOnline () |
BOOL | OnPacket (CBTPacket *pPacket) |
void | SendBeHandshake () |
BOOL | OnBeHandshake (CBTPacket *pPacket) |
BOOL | OnSourceRequest (CBTPacket *pPacket) |
void | DetermineUserAgent () |
Protected Attributes | |
BOOL | m_bShake |
BOOL | m_bOnline |
BOOL | m_bClosing |
|
Definition at line 51 of file BTClient.cpp. References CBTClients::Add(), CSettings::Bandwidth, BTClients, m_bClosing, m_bExchange, m_bExtended, m_bOnline, m_bShake, CConnection::m_mInput, CConnection::m_mOutput, m_pDownload, m_pDownloadTransfer, m_pUpload, CConnection::m_sUserAgent, NULL, TCPBandwidthMeter::pLimit, CSettings::sBandwidth::Request, and Settings. |
|
Definition at line 69 of file BTClient.cpp. References BTClients, CConnection::m_hSocket, m_pDownload, m_pDownloadTransfer, m_pUpload, NULL, and CBTClients::Remove(). |
|
Reimplemented from CTransfer. Definition at line 102 of file BTClient.cpp. References CTransfer::AttachTo(), IDS_BT_CLIENT_ACCEPTED, CConnection::m_hSocket, CConnection::m_sAddress, CShareazaApp::Message(), MSG_DEFAULT, and theApp. Referenced by CBTClients::OnAccept(). |
|
Reimplemented from CTransfer. Definition at line 112 of file BTClient.cpp. References CTransfer::Close(), CDownloadTransferBT::Close(), CUploadTransferBT::Close(), CDownload::IsCompleted(), m_bClosing, m_pDownload, m_pDownloadTransfer, m_pUpload, NULL, TS_FALSE, and TS_UNKNOWN. Referenced by CUploadTransferBT::Close(), CDownloadTransferBT::Close(), OnDropped(), OnHandshake1(), OnHandshake2(), and OnRun(). |
|
Definition at line 82 of file BTClient.cpp. References CTransfer::ConnectTo(), IDS_BT_CLIENT_CONNECTING, CConnection::m_hSocket, CDownloadSource::m_nPort, CDownloadSource::m_pAddress, m_pDownload, m_pDownloadTransfer, CConnection::m_sAddress, CShareazaApp::Message(), MSG_DEFAULT, NULL, and theApp. Referenced by CDownloadTransferBT::Initiate(). |
|
Definition at line 534 of file BTClient.cpp. References SHA1::b, CUploadTransfer::m_bClientExtended, CDownloadSource::m_bClientExtended, m_bExtended, CDownloadSource::m_bPushOnly, m_pDownloadTransfer, m_pGUID, CDownloadTransfer::m_pSource, m_pUpload, CUploadTransfer::m_sNick, CDownloadSource::m_sNick, CDownloadSource::m_sServer, CConnection::m_sUserAgent, and NULL. Referenced by OnHandshake2(). |
|
Definition at line 79 of file BTClient.h. References m_bOnline. Referenced by CDownloadTransferBT::Close(), and CDownloadTransferBT::SendFinishedBlock(). |
|
|
Reimplemented from CConnection. Definition at line 212 of file BTClient.cpp. References IDS_BT_CLIENT_HANDSHAKING, CConnection::m_sAddress, CShareazaApp::Message(), MSG_DEFAULT, SendHandshake(), and theApp. |
|
Reimplemented from CConnection. Definition at line 222 of file BTClient.cpp. References Close(), IDS_BT_CLIENT_DROP_CONNECTED, IDS_BT_CLIENT_DROP_CONNECTING, IDS_BT_CLIENT_DROP_HANDSHAKE, CConnection::m_bConnected, m_bOnline, CConnection::m_sAddress, CShareazaApp::Message(), MSG_ERROR, and theApp. |
|
|
|
Definition at line 779 of file BTClient.cpp. References CDownloadWithTorrent::CreateBitfieldPacket(), CDownloadWithFile::GetDisplayName(), IDS_BT_CLIENT_ONLINE, m_bExtended, m_bOnline, m_pDownload, m_pDownloadTransfer, m_pUpload, CConnection::m_sAddress, CShareazaApp::Message(), MSG_DEFAULT, NULL, CUploadTransferBT::OnConnected(), CDownloadTransferBT::OnConnected(), Send(), SendBeHandshake(), and theApp. Referenced by OnHandshake2(). |
|
|
Reimplemented from CConnection. Definition at line 246 of file BTClient.cpp. References BT_PROTOCOL_HEADER_LEN, m_bOnline, m_bShake, CBuffer::m_nLength, CConnection::m_pInput, OnHandshake1(), OnHandshake2(), OnPacket(), CConnection::OnRead(), CBTPacket::ReadBuffer(), and CPacket::Release(). |
|
|
Definition at line 935 of file BTClient.cpp. References CBENode::Add(), BT_PACKET_SOURCE_RESPONSE, dtsRequesting, CBENode::Encode(), CBENode::GetCount(), CDownloadWithSources::GetFirstSource(), CSourceURL::m_bBTC, CSourceURL::m_pBTC, m_pDownload, CBTPacket::New(), NULL, CSourceURL::Parse(), PROTOCOL_BT, PROTOCOL_HTTP, Send(), and CPacket::Write(). Referenced by OnPacket(). |
|
Reimplemented from CConnection. Definition at line 237 of file BTClient.cpp. References CConnection::OnWrite(). Referenced by OnRun(), Send(), and SendHandshake(). |
|
Definition at line 141 of file BTClient.cpp. References m_bOnline, CConnection::m_hSocket, CPacket::m_nProtocol, CConnection::m_pOutput, NULL, OnWrite(), PROTOCOL_BT, CPacket::Release(), and CBTPacket::ToBuffer(). Referenced by CDownloadTransferBT::Close(), OnBeHandshake(), OnOnline(), OnSourceRequest(), CDownloadTransferBT::Send(), SendBeHandshake(), CUploadTransferBT::ServeRequests(), and CUploadTransferBT::SetChoke(). |
|
Definition at line 852 of file BTClient.cpp. References CBENode::Add(), BT_PACKET_HANDSHAKE, CBENode::Encode(), CGProfile::GetNick(), MyProfile, CBTPacket::New(), Send(), Settings, CSettings::SmartAgent(), and CPacket::Write(). Referenced by OnOnline(). |
|
Definition at line 300 of file BTClient.cpp. References CBuffer::Add(), BT_PROTOCOL_HEADER, CDownloadBase::m_pBTH, m_pDownload, CConnection::m_pOutput, CDownloadWithTorrent::m_pPeerID, NULL, OnWrite(), and CBuffer::Print(). Referenced by OnConnected(), and OnHandshake1(). |
|
Definition at line 51 of file BTClient.h. Referenced by CBTClient(), and Close(). |
|
Definition at line 43 of file BTClient.h. Referenced by CBTClient(), OnBeHandshake(), OnPacket(), and CDownloadTransferBT::OnRun(). |
|
Definition at line 42 of file BTClient.h. Referenced by CBTClient(), DetermineUserAgent(), OnHandshake2(), OnOnline(), and OnPacket(). |
|
Definition at line 50 of file BTClient.h. Referenced by CBTClient(), IsOnline(), OnDropped(), OnHandshake1(), OnHandshake2(), OnOnline(), OnRead(), OnRun(), and Send(). |
|
Definition at line 49 of file BTClient.h. Referenced by CBTClient(), OnHandshake1(), and OnRead(). |
|
Definition at line 46 of file BTClient.h. Referenced by CBTClient(), Close(), Connect(), OnHandshake1(), OnHandshake2(), OnOnline(), OnPacket(), OnSourceRequest(), SendHandshake(), and ~CBTClient(). |
|
Definition at line 47 of file BTClient.h. Referenced by CBTClient(), CDownloadTransferBT::Close(), Close(), Connect(), DetermineUserAgent(), OnBeHandshake(), OnHandshake1(), OnHandshake2(), OnOnline(), OnPacket(), OnRun(), and ~CBTClient(). |
|
Definition at line 41 of file BTClient.h. Referenced by CDownloadWithTorrent::CreateTorrentTransfer(), DetermineUserAgent(), OnHandshake2(), and CDownloadWithTorrent::UploadExists(). |
|
Definition at line 45 of file BTClient.h. Referenced by CBTClient(), CUploadTransferBT::Close(), Close(), DetermineUserAgent(), OnBeHandshake(), OnHandshake2(), OnOnline(), OnPacket(), OnRun(), and ~CBTClient(). |