CUpnpHttpFileTransferReader Class Reference

class CUpnpHttpFileTransferReader : public CActive
CUpnpHttpFileTransferReader is responsible for asynchronous reading. Reader starta reading in asynchronous mode. Issues reading and then waits for the operation to be completed. When it is completed then received data is forwarded to upper layer - CUpnpTcpSession and the new read operation is issues. This continues in loop until the Cancel() is invoked or object is destroyed. DLNAWebServer.lib
Since
Series60 3.2

Inherits from

Public Member Functions
~CUpnpHttpFileTransferReader ()
TBool Activated ()
void AppendL (const TDesC8 &)
TInt CalculateBufferSize ( TInt , TInt )
void CancelTimers ()
CUpnpHttpFileTransferReader * NewL ( CUpnpTcpSession &, RSocket &, TThreadPriority , TInt , TInt )
void Reset ()
void SetActivated ( TBool )
void StartL ()
Protected Member Functions
CUpnpHttpFileTransferReader ( CUpnpTcpSession &, RSocket &, TThreadPriority , TInt , TInt )
TInt AvailableSpace ()
void BaseConstructL ()
void DoCancel ()
void Finish ()
void HandleError ()
TBool HandleL ()
void HandleOneBufferShortTransferL ()
void InitiateBufferL ()
void IssueRead ()
TInt ReadBufferSize ()
void ReadFromSocket ()
TInt RemainingBytes ()
TInt RunError ( TInt )
void RunL ()
void StartCancelTimer ()
TInt TcpFinFoundRemainingBytes ()
void TimerEventL ( CUpnpNotifyTimer *)
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Inherited Enumerations
CActive:TPriority
Protected Attributes
TInt iBufferSize
RBuf8 iCacheBuffer
TBool iCancelFromTimer
CUpnpNotifyTimer * iCancelTimer
TBool iIsActivated
TInt iIsFinished
TSockXfrLength iLen
TInt iReadBufferSize
TPtr8 iReceivePtr
TInt iRetryErrorCount
CUpnpNotifyTimer * iRetryTimer
CUpnpTcpSession & iSession
RSocket & iSocket
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CUpnpHttpFileTransferReader(CUpnpTcpSession &, RSocket &, TThreadPriority, TInt, TInt)

CUpnpHttpFileTransferReader ( CUpnpTcpSession & aSession,
RSocket & aSocket,
TThreadPriority aPriority,
TInt aReadPortion,
TInt aBufferSize
) [protected]
CUpnpHttpFileTransferReader constructor.
Since
Series60 3.2

Parameters

CUpnpTcpSession & aSession session that runs and supervises reader.
RSocket & aSocket socket from which data will be read.
TThreadPriority aPriority priority with which the reader will be working.
TInt aReadPortion - size of the buffer to read from the socket
TInt aBufferSize - the buffer size

~CUpnpHttpFileTransferReader()

~CUpnpHttpFileTransferReader ( ) [virtual]
Virtual destructor.
Since
Series60 3.2

Member Functions Documentation

Activated()

TBool Activated ( )
Checks if the reader is started meaning in use
Since
Series60 3.2

AppendL(const TDesC8 &)

void AppendL ( const TDesC8 & aBeginning )
Appends first portion of data to the buffer.
Since
Series60 3.2

Parameters

const TDesC8 & aBeginning

AvailableSpace()

TInt AvailableSpace ( ) [protected]
Returns how many bytes will still fit into the buffer
Since
Series60 3.2

BaseConstructL()

void BaseConstructL ( ) [protected]
Base constructor to be used also in derived classes.
Since
Series60 3.2

CalculateBufferSize(TInt, TInt)

TInt CalculateBufferSize ( TInt aReadPortion,
TInt aBufferSize
) [static]
Calculates the buffer size as exponent of 2 and proper for read portions
Since
Series60 3.2

Parameters

TInt aReadPortion
TInt aBufferSize

CancelTimers()

void CancelTimers ( )
Cancel the timers
Since
Series60 3.2

DoCancel()

void DoCancel ( ) [protected, virtual]
Cancels issued reading request. Standard active object function
Since
Series60 3.2

Finish()

void Finish ( ) [protected, virtual]
Finish the session
Since
Series60 3.2

HandleError()

void HandleError ( ) [protected]
Handles leave from RunL
Since
Series60 3.2

HandleL()

TBool HandleL ( ) [protected, virtual]
Handles buffer of data
Since
Series60 3.2

HandleOneBufferShortTransferL()

void HandleOneBufferShortTransferL ( ) [protected]
If content length is less than single buffer size transaction is completed and session is closed
Since
Series60 3.2

InitiateBufferL()

void InitiateBufferL ( ) [protected]
Initiates the buffer
Since
Series60 3.2

IssueRead()

void IssueRead ( ) [protected]
Issues reading in asynchronous mode.
Since
Series60 3.2

NewL(CUpnpTcpSession &, RSocket &, TThreadPriority, TInt, TInt)

CUpnpHttpFileTransferReader * NewL ( CUpnpTcpSession & aSession,
RSocket & aSocket,
TThreadPriority aPriority,
TInt aReadPortion,
TInt aBufferSize
) [static]
CUpnpHttpFileTransferReader factory method.
Since
Series60 3.2

Parameters

CUpnpTcpSession & aSession session that runs and supervises reader.
RSocket & aSocket socket from which data will be read.
TThreadPriority aPriority priority with which the reader will be working.
TInt aReadPortion - size of the buffer to read from the socket
TInt aBufferSize - the buffer size

ReadBufferSize()

TInt ReadBufferSize ( ) [protected, virtual]
Remaing number of bytes to read.
Since
Series60 3.2

ReadFromSocket()

void ReadFromSocket ( ) [protected, virtual]
Reads from socket
Since
Series60 3.2

RemainingBytes()

TInt RemainingBytes ( ) [protected, virtual]
Remaing number of bytes to read.
Since
Series60 3.2

Reset()

void Reset ( ) [virtual]
Resets some member values to start reading data
Since
Series60 3.2

RunError(TInt)

TInt RunError ( TInt aError ) [protected, virtual]
Trap RunL leaves Standard active object function
Since
Series60 3.2

Parameters

TInt aError

RunL()

void RunL ( ) [protected, virtual]
Function called when the read request is finished. Standard active object function
Since
Series60 3.2

SetActivated(TBool)

void SetActivated ( TBool aValue )
Sets the state of the reader to activated
Since
Series60 3.2

Parameters

TBool aValue

StartCancelTimer()

void StartCancelTimer ( ) [protected]
Starts the cancel timer.
Since
Series60 3.2

StartL()

void StartL ( ) [virtual]
Starts reading in asynchronous mode.
Since
Series60 3.2

TcpFinFoundRemainingBytes()

TInt TcpFinFoundRemainingBytes ( ) [protected]
Returns bytes to be read unless FIN received, then returns 0
Since
Series60 3.2

TimerEventL(CUpnpNotifyTimer *)

void TimerEventL ( CUpnpNotifyTimer * ) [protected]
Callback function for timer expirations.
Since
Series60 2.6

Parameters

CUpnpNotifyTimer * Timer that has expired.

Member Data Documentation

TInt iBufferSize

TInt iBufferSize [protected]

RBuf8 iCacheBuffer

RBuf8 iCacheBuffer [protected]

TBool iCancelFromTimer

TBool iCancelFromTimer [protected]

Variable indicating when the cancel was called from cancel timer.

CUpnpNotifyTimer * iCancelTimer

CUpnpNotifyTimer * iCancelTimer [protected]

Timer used for cancel reciving process.

TBool iIsActivated

TBool iIsActivated [protected]

TInt iIsFinished

TInt iIsFinished [protected]

TSockXfrLength iLen

TSockXfrLength iLen [protected]

TInt iReadBufferSize

TInt iReadBufferSize [protected]

TPtr8 iReceivePtr

TPtr8 iReceivePtr [protected]

TInt iRetryErrorCount

TInt iRetryErrorCount [protected]

Count of reading errors.

CUpnpNotifyTimer * iRetryTimer

CUpnpNotifyTimer * iRetryTimer [protected]

Timer used for retry process.

CUpnpTcpSession & iSession

CUpnpTcpSession & iSession [protected]

RSocket & iSocket

RSocket & iSocket [protected]