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()
voidAppendL(const TDesC8 &)
TInt CalculateBufferSize(TInt, TInt)
voidCancelTimers()
CUpnpHttpFileTransferReader *NewL(CUpnpTcpSession &, RSocket &, TThreadPriority, TInt, TInt)
voidReset()
voidSetActivated(TBool)
voidStartL()
Protected Member Functions
CUpnpHttpFileTransferReader(CUpnpTcpSession &, RSocket &, TThreadPriority, TInt, TInt)
TInt AvailableSpace()
voidBaseConstructL()
voidDoCancel()
voidFinish()
voidHandleError()
TBool HandleL()
voidHandleOneBufferShortTransferL()
voidInitiateBufferL()
voidIssueRead()
TInt ReadBufferSize()
voidReadFromSocket()
TInt RemainingBytes()
TInt RunError(TInt)
voidRunL()
voidStartCancelTimer()
TInt TcpFinFoundRemainingBytes()
voidTimerEventL(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,
TThreadPriorityaPriority,
TIntaReadPortion,
TIntaBufferSize
)[protected]
CUpnpHttpFileTransferReader constructor.
Since
Series60 3.2

Parameters

CUpnpTcpSession & aSessionsession that runs and supervises reader.
RSocket & aSocketsocket from which data will be read.
TThreadPriority aPrioritypriority 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 &)

voidAppendL(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()

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

CalculateBufferSize(TInt, TInt)

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

Parameters

TInt aReadPortion
TInt aBufferSize

CancelTimers()

voidCancelTimers()
Cancel the timers
Since
Series60 3.2

DoCancel()

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

Finish()

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

HandleError()

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

HandleL()

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

HandleOneBufferShortTransferL()

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

InitiateBufferL()

voidInitiateBufferL()[protected]
Initiates the buffer
Since
Series60 3.2

IssueRead()

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

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

CUpnpHttpFileTransferReader *NewL(CUpnpTcpSession &aSession,
RSocket &aSocket,
TThreadPriorityaPriority,
TIntaReadPortion,
TIntaBufferSize
)[static]
CUpnpHttpFileTransferReader factory method.
Since
Series60 3.2

Parameters

CUpnpTcpSession & aSessionsession that runs and supervises reader.
RSocket & aSocketsocket from which data will be read.
TThreadPriority aPrioritypriority 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()

voidReadFromSocket()[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()

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

RunError(TInt)

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

Parameters

TInt aError

RunL()

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

SetActivated(TBool)

voidSetActivated(TBoolaValue)
Sets the state of the reader to activated
Since
Series60 3.2

Parameters

TBool aValue

StartCancelTimer()

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

StartL()

voidStartL()[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 *)

voidTimerEventL(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]