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

CUploadTransferBT Class Reference

#include <UploadTransferBT.h>

Inheritance diagram for CUploadTransferBT:

CUploadTransfer CTransfer CConnection List of all members.

Public Member Functions

 CUploadTransferBT (CBTClient *pClient, CDownload *pDownload)
virtual ~CUploadTransferBT ()
void SetChoke (BOOL bChoke)
virtual void Close (BOOL bMessage=FALSE)
virtual DWORD GetMeasuredSpeed ()
virtual BOOL OnConnected ()
virtual BOOL OnRun ()
BOOL OnInterested (CBTPacket *pPacket)
BOOL OnUninterested (CBTPacket *pPacket)
BOOL OnRequest (CBTPacket *pPacket)
BOOL OnCancel (CBTPacket *pPacket)

Public Attributes

CBTClientm_pClient
CDownloadm_pDownload
BOOL m_bInterested
BOOL m_bChoked
int m_nRandomUnchoke
DWORD m_tRandomUnchoke

Protected Member Functions

BOOL OpenFile ()
BOOL ServeRequests ()

Private Attributes

FF::SimpleFragmentQueue m_oRequested
FF::SimpleFragmentQueue m_oServed

Constructor & Destructor Documentation

CUploadTransferBT::CUploadTransferBT CBTClient pClient,
CDownload pDownload
 

Definition at line 49 of file UploadTransferBT.cpp.

References CDownloadWithTorrent::AddUpload(), m_bChoked, m_bInterested, m_nRandomUnchoke, CUploadTransfer::m_nState, m_pClient, m_pDownload, CConnection::m_pHost, CConnection::m_sAddress, CConnection::m_sUserAgent, NULL, CUploadTransfer::RequestPartial(), and upsReady.

CUploadTransferBT::~CUploadTransferBT  )  [virtual]
 

Definition at line 69 of file UploadTransferBT.cpp.

References m_pClient, m_pDownload, and NULL.


Member Function Documentation

void CUploadTransferBT::Close BOOL  bMessage = FALSE  )  [virtual]
 

Reimplemented from CUploadTransfer.

Definition at line 107 of file UploadTransferBT.cpp.

References FF::detail::Queue::clear(), CTransfer::Close(), CBTClient::Close(), CUploadTransfer::CloseFile(), m_oRequested, m_oServed, m_pClient, CUploadTransfer::m_pDiskFile, m_pDownload, CBTClient::m_pUpload, NULL, and CDownloadWithTorrent::RemoveUpload().

Referenced by CBTClient::Close(), and CDownloadWithTorrent::CloseTorrentUploads().

DWORD CUploadTransferBT::GetMeasuredSpeed  )  [virtual]
 

Reimplemented from CUploadTransfer.

Definition at line 130 of file UploadTransferBT.cpp.

References CConnection::m_mOutput, m_pClient, CConnection::Measure(), TCPBandwidthMeter::nMeasure, and NULL.

BOOL CUploadTransferBT::OnCancel CBTPacket pPacket  ) 
 

Definition at line 219 of file UploadTransferBT.cpp.

References FF::detail::Queue::erase(), CPacket::GetRemaining(), CBTInfo::m_nBlockSize, m_oRequested, m_pDownload, CDownloadWithTorrent::m_pTorrent, and CPacket::ReadLongBE().

Referenced by CBTClient::OnPacket().

BOOL CUploadTransferBT::OnConnected  )  [virtual]
 

Reimplemented from CConnection.

Definition at line 140 of file UploadTransferBT.cpp.

References CConnection::m_mOutput, CUploads::m_nTorrentSpeed, m_pClient, TCPBandwidthMeter::pLimit, and Uploads.

Referenced by CBTClient::OnOnline().

BOOL CUploadTransferBT::OnInterested CBTPacket pPacket  ) 
 

Definition at line 158 of file UploadTransferBT.cpp.

References m_bInterested.

Referenced by CBTClient::OnPacket().

BOOL CUploadTransferBT::OnRequest CBTPacket pPacket  ) 
 

Definition at line 176 of file UploadTransferBT.cpp.

References CUploadTransfer::AllocateBaseFile(), FF::detail::Queue::begin(), CSettings::BitTorrent, CTransfer::Close(), FF::detail::Queue::end(), IDS_UPLOAD_FILE, m_bChoked, CBTInfo::m_nBlockSize, CUploadTransfer::m_nFileSize, CUploadTransfer::m_nState, m_oRequested, m_oServed, m_pDownload, CDownloadWithTorrent::m_pTorrent, CConnection::m_sAddress, CUploadTransfer::m_sFileName, CShareazaApp::Message(), MSG_DEBUG, MSG_SYSTEM, FF::detail::Queue::pushBack(), CSettings::sBitTorrent::RequestLimit, ServeRequests(), Settings, theApp, upsReady, and upsRequest.

Referenced by CBTClient::OnPacket().

BOOL CUploadTransferBT::OnRun  )  [virtual]
 

Reimplemented from CUploadTransfer.

Definition at line 149 of file UploadTransferBT.cpp.

References m_bChoked, CUploadTransfer::m_nState, ServeRequests(), and upsRequest.

Referenced by CBTClient::OnRun().

BOOL CUploadTransferBT::OnUninterested CBTPacket pPacket  ) 
 

Definition at line 165 of file UploadTransferBT.cpp.

References m_bInterested, CUploadTransfer::m_nState, and upsReady.

Referenced by CBTClient::OnPacket().

BOOL CUploadTransferBT::OpenFile  )  [protected]
 

Definition at line 237 of file UploadTransferBT.cpp.

References CTransfer::Close(), IDS_UPLOAD_CANTOPEN, CUploadTransfer::m_nState, CUploadTransfer::m_pBaseFile, CUploadTransfer::m_pDiskFile, CConnection::m_sAddress, CUploadTransfer::m_sFileName, CUploadTransfer::m_sFilePath, CShareazaApp::Message(), MSG_ERROR, NULL, CTransferFiles::Open(), theApp, TransferFiles, upsRequest, and upsUploading.

Referenced by ServeRequests().

BOOL CUploadTransferBT::ServeRequests  )  [protected]
 

Definition at line 255 of file UploadTransferBT.cpp.

References CUploadFile::AddFragment(), FF::detail::Queue::begin(), CSettings::BitTorrent, BT_PACKET_PIECE, CStatistics::Current, FF::detail::Queue::empty(), FF::detail::Queue::end(), CBuffer::EnsureBuffer(), IDS_UPLOAD_CONTENT, m_bChoked, CBTInfo::m_nBlockSize, CUploadTransfer::m_nFileSize, CBuffer::m_nLength, CUploadTransfer::m_nLength, CUploadTransfer::m_nOffset, CUploadTransfer::m_nPosition, CUploadTransfer::m_nState, CDownloadWithTorrent::m_nTorrentUploaded, CUploadTransfer::m_nUploaded, m_oRequested, m_oServed, CUploadTransfer::m_pBaseFile, CBuffer::m_pBuffer, m_pClient, CUploadTransfer::m_pDiskFile, m_pDownload, CConnection::m_pOutput, CDownloadWithTorrent::m_pTorrent, CConnection::m_sAddress, CUploadTransfer::m_sFileName, CShareazaApp::Message(), MSG_DEBUG, BT_PIECE_HEADER::nLength, BT_PIECE_HEADER::nOffset, BT_PIECE_HEADER::nPiece, BT_PIECE_HEADER::nType, NULL, OpenFile(), FF::detail::Queue::popFront(), FF::detail::Queue::pushBack(), CTransferFile::Read(), CSettings::sBitTorrent::RequestSize, CBTClient::Send(), Settings, SIZE_UNKNOWN, Statistics, SWAP_LONG, theApp, upsRequest, and upsUploading.

Referenced by OnRequest(), and OnRun().

void CUploadTransferBT::SetChoke BOOL  bChoke  ) 
 

Definition at line 78 of file UploadTransferBT.cpp.

References BT_PACKET_CHOKE, BT_PACKET_UNCHOKE, FF::detail::Queue::clear(), m_bChoked, CUploadTransfer::m_nState, m_oRequested, m_oServed, m_pClient, CConnection::m_sAddress, CShareazaApp::Message(), CUploadFiles::MoveToHead(), CUploadFiles::MoveToTail(), MSG_DEBUG, CBTPacket::New(), CBTClient::Send(), theApp, UploadFiles, and upsReady.

Referenced by CDownloadWithTorrent::ChokeTorrent().


Member Data Documentation

BOOL CUploadTransferBT::m_bChoked
 

Definition at line 47 of file UploadTransferBT.h.

Referenced by CUploadTransferBT(), OnRequest(), OnRun(), CUploads::OnRun(), CRemote::PageUploads(), CUploadsCtrl::PaintFile(), ServeRequests(), and SetChoke().

BOOL CUploadTransferBT::m_bInterested
 

Definition at line 46 of file UploadTransferBT.h.

Referenced by CDownloadWithTorrent::ChokeTorrent(), CUploadTransferBT(), OnInterested(), CUploads::OnRun(), OnUninterested(), CRemote::PageUploads(), and CUploadsCtrl::PaintFile().

int CUploadTransferBT::m_nRandomUnchoke
 

Definition at line 48 of file UploadTransferBT.h.

Referenced by CDownloadWithTorrent::ChokeTorrent(), and CUploadTransferBT().

FF::SimpleFragmentQueue CUploadTransferBT::m_oRequested [private]
 

Definition at line 51 of file UploadTransferBT.h.

Referenced by Close(), OnCancel(), OnRequest(), ServeRequests(), and SetChoke().

FF::SimpleFragmentQueue CUploadTransferBT::m_oServed [private]
 

Definition at line 52 of file UploadTransferBT.h.

Referenced by Close(), OnRequest(), ServeRequests(), and SetChoke().

CBTClient* CUploadTransferBT::m_pClient
 

Definition at line 43 of file UploadTransferBT.h.

Referenced by CDownloadWithTorrent::ChokeTorrent(), Close(), CUploadTransferBT(), GetMeasuredSpeed(), OnConnected(), ServeRequests(), SetChoke(), CDownloadWithTorrent::UploadExists(), and ~CUploadTransferBT().

CDownload* CUploadTransferBT::m_pDownload
 

Definition at line 44 of file UploadTransferBT.h.

Referenced by Close(), CUploadTransferBT(), OnCancel(), OnRequest(), ServeRequests(), and ~CUploadTransferBT().

DWORD CUploadTransferBT::m_tRandomUnchoke
 

Definition at line 49 of file UploadTransferBT.h.

Referenced by CDownloadWithTorrent::ChokeTorrent().


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