LLXfer Class Reference

#include <llxfer.h>

Inheritance diagram for LLXfer:

Inheritance graph
[legend]
Collaboration diagram for LLXfer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LLXfer (S32 chunk_size)
virtual ~LLXfer ()
void init (S32 chunk_size)
virtual void free ()
virtual S32 startSend (U64 xfer_id, const LLHost &remote_host)
virtual void sendPacket (S32 packet_num)
virtual void sendNextPacket ()
virtual void resendLastPacket ()
virtual S32 processEOF ()
virtual S32 startDownload ()
virtual S32 receiveData (char *datap, S32 data_size)
virtual void abort (S32)
virtual S32 suck (S32 start_position)
virtual S32 flush ()
virtual S32 encodePacketNum (S32 packet_num, BOOL is_eof)
virtual void setXferSize (S32 data_size)
virtual S32 getMaxBufferSize ()
virtual const char * getName ()
virtual U32 getXferTypeTag ()

Public Attributes

LLXfermNext
U64 mID
S32 mPacketNum
LLHost mRemoteHost
S32 mXferSize
char * mBuffer
U32 mBufferLength
U32 mBufferStartOffset
BOOL mBufferContainsEOF
ELLXferStatus mStatus
BOOL mWaitingForACK
void(* mCallback )(void **, S32, LLExtStat)
void ** mCallbackDataHandle
S32 mCallbackResult
LLTimer ACKTimer
S32 mRetries

Static Public Attributes

static const U32 XFER_FILE = 1
static const U32 XFER_VFILE = 2
static const U32 XFER_MEM = 3

Protected Attributes

S32 mChunkSize

Friends

std::ostream & operator<< (std::ostream &os, LLXfer &hh)

Detailed Description

Definition at line 50 of file llxfer.h.


Constructor & Destructor Documentation

LLXfer::LLXfer ( S32  chunk_size  ) 

Definition at line 49 of file llxfer.cpp.

References init().

LLXfer::~LLXfer (  )  [virtual]

Definition at line 56 of file llxfer.cpp.

References free().


Member Function Documentation

void LLXfer::abort ( S32   )  [virtual]

Definition at line 326 of file llxfer.cpp.

References _PREHASH_AbortXfer, _PREHASH_ID, _PREHASH_Result, _PREHASH_XferID, LLMessageSystem::addS32Fast(), LLMessageSystem::addU64Fast(), e_LL_XFER_ABORTED, getName(), gMessageSystem, llendl, llinfos, mCallbackResult, mID, mRemoteHost, mStatus, LLMessageSystem::newMessageFast(), LLMessageSystem::nextBlockFast(), and LLMessageSystem::sendMessage().

Referenced by LLXferManager::processReceiveData(), LLXferManager::retransmitUnackedPackets(), sendPacket(), and LLXferManager::startPendingDownloads().

S32 LLXfer::encodePacketNum ( S32  packet_num,
BOOL  is_eof 
) [virtual]

Definition at line 315 of file llxfer.cpp.

Referenced by sendPacket().

S32 LLXfer::flush (  )  [virtual]

Reimplemented in LLXfer_File, and LLXfer_VFile.

Definition at line 156 of file llxfer.cpp.

Referenced by receiveData().

void LLXfer::free (  )  [virtual]

Reimplemented in LLXfer_File, LLXfer_Mem, and LLXfer_VFile.

Definition at line 93 of file llxfer.cpp.

References mBuffer, and NULL.

Referenced by LLXfer_VFile::free(), LLXfer_Mem::free(), LLXfer_File::free(), and ~LLXfer().

S32 LLXfer::getMaxBufferSize (  )  [virtual]

Reimplemented in LLXfer_File, and LLXfer_VFile.

Definition at line 362 of file llxfer.cpp.

References mXferSize.

Referenced by receiveData().

const char * LLXfer::getName (  )  [virtual]

Reimplemented in LLXfer_File, and LLXfer_VFile.

Definition at line 346 of file llxfer.cpp.

References mID, and U64_to_str().

Referenced by abort(), operator<<(), LLXfer_Mem::processEOF(), processEOF(), LLXferManager::processReceiveData(), LLXferManager::retransmitUnackedPackets(), startDownload(), and startSend().

U32 LLXfer::getXferTypeTag (  )  [virtual]

Reimplemented in LLXfer_File, LLXfer_Mem, and LLXfer_VFile.

Definition at line 355 of file llxfer.cpp.

Referenced by LLXferManager::requestFile(), and LLXferManager::requestVFile().

void LLXfer::init ( S32  chunk_size  ) 

Definition at line 63 of file llxfer.cpp.

References e_LL_XFER_UNINITIALIZED, FALSE, LL_XFER_CHUNK_SIZE, mBuffer, mBufferContainsEOF, mBufferLength, mBufferStartOffset, mCallback, mCallbackDataHandle, mChunkSize, mID, mNext, mPacketNum, mRetries, mStatus, mWaitingForACK, mXferSize, and NULL.

Referenced by LLXfer().

S32 LLXfer::processEOF (  )  [virtual]

Reimplemented in LLXfer_File, LLXfer_Mem, and LLXfer_VFile.

Definition at line 288 of file llxfer.cpp.

References e_LL_XFER_COMPLETE, getName(), LL_ERR_NOERR, LL_EXSTAT_NONE, llendl, llinfos, mCallback, mCallbackDataHandle, mCallbackResult, mRemoteHost, mStatus, and S32.

Referenced by LLXferManager::processAbort(), LLXfer_VFile::processEOF(), LLXfer_File::processEOF(), LLXferManager::processReceiveData(), and LLXferManager::retransmitUnackedPackets().

S32 LLXfer::receiveData ( char *  datap,
S32  data_size 
) [virtual]

Definition at line 129 of file llxfer.cpp.

References flush(), getMaxBufferSize(), llendl, llerrs, mBuffer, mBufferLength, NULL, and S32.

Referenced by LLXferManager::processReceiveData().

void LLXfer::resendLastPacket (  )  [virtual]

Definition at line 280 of file llxfer.cpp.

References mPacketNum, mRetries, and sendPacket().

Referenced by LLXferManager::retransmitUnackedPackets().

void LLXfer::sendNextPacket (  )  [virtual]

Definition at line 272 of file llxfer.cpp.

References mPacketNum, mRetries, and sendPacket().

Referenced by LLXferManager::processConfirmation(), LLXferManager::processFileRequest(), and LLXferManager::retransmitUnackedPackets().

void LLXfer::sendPacket ( S32  packet_num  )  [virtual]

Definition at line 176 of file llxfer.cpp.

References _PREHASH_Data, _PREHASH_DataPacket, _PREHASH_ID, _PREHASH_Packet, _PREHASH_SendXferPacket, _PREHASH_XferID, abort(), ACKTimer, LLMessageSystem::addBinaryDataFast(), LLMessageSystem::addU32Fast(), LLMessageSystem::addU64Fast(), e_LL_XFER_COMPLETE, e_LL_XFER_IN_PROGRESS, encodePacketNum(), FALSE, gMessageSystem, htonmemcpy(), LL_ERR_EOF, LL_XFER_LARGE_PAYLOAD, llendl, llmin(), llwarns, mBuffer, mBufferContainsEOF, mBufferLength, mBufferStartOffset, mChunkSize, mID, mRemoteHost, mStatus, MVT_S32, mWaitingForACK, mXferSize, LLMessageSystem::newMessageFast(), LLMessageSystem::nextBlockFast(), LLTimer::reset(), S32, LLMessageSystem::sendMessage(), suck(), and TRUE.

Referenced by resendLastPacket(), and sendNextPacket().

void LLXfer::setXferSize ( S32  data_size  )  [virtual]

Reimplemented in LLXfer_Mem, and LLXfer_VFile.

Definition at line 112 of file llxfer.cpp.

References mXferSize.

Referenced by LLXferManager::processReceiveData(), LLXfer_VFile::setXferSize(), and LLXfer_File::startSend().

S32 LLXfer::startDownload (  )  [virtual]

Reimplemented in LLXfer_File, LLXfer_Mem, and LLXfer_VFile.

Definition at line 120 of file llxfer.cpp.

References getName(), llendl, and llwarns.

Referenced by LLXferManager::startPendingDownloads().

S32 LLXfer::startSend ( U64  xfer_id,
const LLHost remote_host 
) [virtual]

Reimplemented in LLXfer_File, LLXfer_Mem, and LLXfer_VFile.

Definition at line 104 of file llxfer.cpp.

References getName(), llendl, and llwarns.

Referenced by LLXferManager::processFileRequest().

S32 LLXfer::suck ( S32  start_position  )  [virtual]

Reimplemented in LLXfer_File, and LLXfer_VFile.

Definition at line 168 of file llxfer.cpp.

References llendl, and llwarns.

Referenced by sendPacket().


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
LLXfer hh 
) [friend]

Definition at line 368 of file llxfer.cpp.


Member Data Documentation

LLTimer LLXfer::ACKTimer

Definition at line 77 of file llxfer.h.

Referenced by LLXferManager::retransmitUnackedPackets(), and sendPacket().

char* LLXfer::mBuffer

Definition at line 64 of file llxfer.h.

Referenced by LLXfer_VFile::flush(), LLXfer_File::flush(), free(), init(), LLXfer_VFile::initializeRequest(), LLXfer_Mem::initializeRequest(), LLXfer_File::initializeRequest(), LLXfer_Mem::processEOF(), receiveData(), LLXfer_Mem::registerXfer(), sendPacket(), LLXfer_Mem::setXferSize(), LLXfer_VFile::startSend(), LLXfer_File::startSend(), LLXfer_VFile::suck(), and LLXfer_File::suck().

BOOL LLXfer::mBufferContainsEOF

Definition at line 67 of file llxfer.h.

Referenced by init(), sendPacket(), LLXfer_Mem::setXferSize(), LLXfer_VFile::suck(), and LLXfer_File::suck().

U32 LLXfer::mBufferLength

Definition at line 65 of file llxfer.h.

Referenced by LLXfer_VFile::flush(), LLXfer_File::flush(), init(), LLXfer_VFile::initializeRequest(), LLXfer_Mem::initializeRequest(), LLXfer_File::initializeRequest(), LLXfer_Mem::processEOF(), receiveData(), LLXfer_Mem::registerXfer(), sendPacket(), LLXfer_Mem::setXferSize(), LLXfer_VFile::startSend(), LLXfer_File::startSend(), LLXfer_VFile::suck(), and LLXfer_File::suck().

U32 LLXfer::mBufferStartOffset

Definition at line 66 of file llxfer.h.

Referenced by init(), sendPacket(), LLXfer_Mem::setXferSize(), LLXfer_VFile::startSend(), LLXfer_File::startSend(), LLXfer_VFile::suck(), and LLXfer_File::suck().

void(* LLXfer::mCallback)(void **, S32, LLExtStat)

Reimplemented in LLXfer_Mem.

Referenced by init(), LLXfer_VFile::initializeRequest(), LLXfer_File::initializeRequest(), processEOF(), LLXferManager::requestFile(), and LLXferManager::requestVFile().

void** LLXfer::mCallbackDataHandle

Definition at line 74 of file llxfer.h.

Referenced by init(), LLXfer_VFile::initializeRequest(), LLXfer_Mem::initializeRequest(), LLXfer_File::initializeRequest(), LLXfer_Mem::processEOF(), processEOF(), LLXferManager::requestFile(), and LLXferManager::requestVFile().

S32 LLXfer::mCallbackResult

Definition at line 75 of file llxfer.h.

Referenced by abort(), LLXfer_VFile::initializeRequest(), LLXfer_Mem::initializeRequest(), LLXfer_File::initializeRequest(), LLXferManager::processAbort(), LLXfer_VFile::processEOF(), LLXfer_Mem::processEOF(), LLXfer_File::processEOF(), processEOF(), and LLXferManager::retransmitUnackedPackets().

S32 LLXfer::mChunkSize [protected]

Definition at line 54 of file llxfer.h.

Referenced by init(), sendPacket(), LLXfer_VFile::startDownload(), LLXfer_Mem::startDownload(), and LLXfer_File::startDownload().

U64 LLXfer::mID

Definition at line 58 of file llxfer.h.

Referenced by abort(), LLXferManager::findXfer(), getName(), init(), LLXfer_VFile::initializeRequest(), LLXfer_Mem::initializeRequest(), LLXfer_File::initializeRequest(), LLXfer_Mem::registerXfer(), sendPacket(), LLXfer_VFile::startDownload(), LLXfer_Mem::startDownload(), LLXfer_File::startDownload(), LLXfer_VFile::startSend(), LLXfer_Mem::startSend(), and LLXfer_File::startSend().

LLXfer* LLXfer::mNext

Definition at line 57 of file llxfer.h.

Referenced by LLXferManager::addToList(), LLXferManager::findXfer(), LLXferManager::free(), init(), LLXferManager::numActiveListEntries(), LLXferManager::processFileRequest(), LLXferManager::registerXfer(), LLXferManager::removeXfer(), LLXferManager::requestFile(), LLXferManager::requestVFile(), LLXferManager::retransmitUnackedPackets(), LLXferManager::startPendingDownloads(), and LLXferManager::updateHostStatus().

S32 LLXfer::mPacketNum

Definition at line 59 of file llxfer.h.

Referenced by init(), LLXfer_VFile::initializeRequest(), LLXfer_Mem::initializeRequest(), LLXfer_File::initializeRequest(), LLXferManager::processReceiveData(), resendLastPacket(), LLXferManager::retransmitUnackedPackets(), sendNextPacket(), LLXfer_VFile::startSend(), LLXfer_Mem::startSend(), and LLXfer_File::startSend().

LLHost LLXfer::mRemoteHost

Definition at line 61 of file llxfer.h.

Referenced by abort(), LLXfer_VFile::initializeRequest(), LLXfer_Mem::initializeRequest(), LLXfer_File::initializeRequest(), processEOF(), LLXferManager::processFileRequest(), LLXferManager::processReceiveData(), LLXferManager::requestFile(), LLXferManager::requestVFile(), LLXferManager::retransmitUnackedPackets(), sendPacket(), LLXfer_VFile::startDownload(), LLXfer_Mem::startDownload(), LLXfer_File::startDownload(), LLXfer_VFile::startSend(), LLXfer_Mem::startSend(), LLXfer_File::startSend(), and LLXferManager::updateHostStatus().

S32 LLXfer::mRetries

Definition at line 78 of file llxfer.h.

Referenced by init(), resendLastPacket(), LLXferManager::retransmitUnackedPackets(), and sendNextPacket().

ELLXferStatus LLXfer::mStatus

Definition at line 69 of file llxfer.h.

Referenced by abort(), init(), LLXfer_VFile::initializeRequest(), LLXfer_Mem::initializeRequest(), LLXfer_File::initializeRequest(), LLXferManager::numActiveListEntries(), LLXferManager::processConfirmation(), LLXfer_VFile::processEOF(), LLXfer_Mem::processEOF(), LLXfer_File::processEOF(), processEOF(), LLXfer_Mem::registerXfer(), LLXferManager::retransmitUnackedPackets(), sendPacket(), LLXfer_VFile::startDownload(), LLXfer_Mem::startDownload(), LLXfer_File::startDownload(), LLXferManager::startPendingDownloads(), LLXfer_VFile::startSend(), LLXfer_Mem::startSend(), LLXfer_File::startSend(), and LLXferManager::updateHostStatus().

BOOL LLXfer::mWaitingForACK

Definition at line 71 of file llxfer.h.

Referenced by init(), LLXferManager::processConfirmation(), LLXferManager::retransmitUnackedPackets(), and sendPacket().

S32 LLXfer::mXferSize

Definition at line 62 of file llxfer.h.

Referenced by getMaxBufferSize(), init(), sendPacket(), LLXfer_Mem::setXferSize(), setXferSize(), and LLXfer_Mem::startSend().

const U32 LLXfer::XFER_FILE = 1 [static]

Definition at line 80 of file llxfer.h.

Referenced by LLXfer_File::getXferTypeTag(), and LLXferManager::requestFile().

const U32 LLXfer::XFER_MEM = 3 [static]

Definition at line 82 of file llxfer.h.

Referenced by LLXfer_Mem::getXferTypeTag().

const U32 LLXfer::XFER_VFILE = 2 [static]

Definition at line 81 of file llxfer.h.

Referenced by LLXfer_VFile::getXferTypeTag(), and LLXferManager::requestVFile().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:12:04 2010 for Second Life Viewer by  doxygen 1.4.7