CUpnpTcpSession Class Reference

class CUpnpTcpSession : public CBase
Since
Series60 2.6

Inherits from

Public Member Functions
CUpnpTcpSession(RSocket &, TThreadPriority)
~CUpnpTcpSession()
voidBufferReceivedL(TDesC8 &)
voidCancelTcpReader()
voidCheckConnectionCloseL()
voidCloseSocketL()
voidDeleteServeFileL()
voidDeleteThisSessionL(CUpnpTcpSession *)
voidDisconnectRequestL()
TBool DownloadOngoing()
CUpnpHttpFileAccess *FileAccess()
TBool FileServeExists()
CUpnpHttpFileTransferReader *FileTransferReader()
voidFileTransferReaderDoneL()
voidFileTransferReaderErrorL(TInt)
CUpnpHttpFileTransferWriter *FileTransferWriter()
voidFileTransferWriterDoneL()
voidFileTransferWriterHandleMoreL()
voidHandleErrorL(TInt)
TInt Id()
voidInitialReceiveL()
TBool IsConnected()
TBool IsPersistentConnection()
voidNotifyDisconnectL(TInetAddr)
voidNotifyTimeoutL()
voidNotifyUpperLayersOnPostL()
voidPostingFileCompleteL()
voidReceiveL()
voidReceivingCompletedL(TDesC8 &)
TInetAddr &RemoteHost()
voidServerBusyL()
TInt ServerPort()
voidShutdownStop()
TBool ShuttingDown()
voidSocketServerBusyL(const TInetAddr &)
voidStartClosingSession()
voidStartDisconnect(TBool)
voidStartDisconnectingTimer(TInt)
voidStartTimeoutTimer(TBool)
voidTcpConstructL(RSocket, TInt, TInt)
TInt TimeoutCurrentValue()
voidTimerCancel()
voidTimerEventL(CUpnpNotifyTimer *)
voidWaitRetryError(TInt, TBool)
voidWriteL(const TDesC8 &)
voidWritingCompletedL()
Protected Member Functions
voidDestroyIt(CUpnpTcpSession *)
voidFileTransferReaderConstructL()
voidFileTransferWriterConstructL(TInt)
Private Member Functions
TBool OutstandingWritings()
voidSetState(TUpnpTcpSessionState)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
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()
Private Member Enumerations
enumTUpnpTcpSessionState {
ENotConnected, EConnecting, EConnected, EDisconnecting, EShuttingDownWriteWait, EShuttingDownStop, EShuttingDown, EServerBusy
}
Protected Attributes
TInetAddr iAddr
TBool iContinuedMessageDownload
TBool iDisconnectNotification
TInt iExportRetryCounter
CUpnpHttpFileTransferReader *iFTReader
CUpnpHttpFileTransferWriter *iFTWriter
TInt iFileReadBufferSize
TInt iId
TThreadPriority iInitialPriority
TBool iIsPersistent
TBool iPendingPostRequests
CUpnpHttpBuffer *iReceivedMessage
TBool iSaveToFile
TInt iSessionError
TBool iSessionKeepAlive
TBool iSessionNeedsErrorReply
RSocket iSocket
CUpnpSocketShutdown *iSocketShutdown
TUpnpTcpSessionState iState
CUpnpTcpSessionReader *iTcpReader
CUpnpTcpSessionWriter *iTcpWriter
TInt iTimeoutCurrentValue
TInt iTimeoutSessionValue
CUpnpNotifyTimer *iTimeoutTimer

Constructor & Destructor Documentation

CUpnpTcpSession(RSocket &, TThreadPriority)

CUpnpTcpSession(RSocket &aSocket,
TThreadPriorityaPriority
)

Constructor for building CUpnpTcpSession. This constructor is used when connection is iniatiated from network. Second-phase construction is made by TcpConstructL().

Parameters

RSocket & aSocketPointer to new Socket.
TThreadPriority aPriorityPriority of this session

~CUpnpTcpSession()

~CUpnpTcpSession()[virtual]

Virtual destructor.

Member Functions Documentation

BufferReceivedL(TDesC8 &)

voidBufferReceivedL(TDesC8 &aBuffer)[pure virtual]
Callback function. Called when data has been received.
Since
Series60 2.6

Parameters

TDesC8 & aBufferData that has been received thru session.

CancelTcpReader()

voidCancelTcpReader()

Cancels TcpReader

CheckConnectionCloseL()

voidCheckConnectionCloseL()[pure virtual]
Callback function. Checks if connection uses Connection: Close header, and if so, tries to parse message and send it to upper layers.
Since
Series60 2.6

CloseSocketL()

voidCloseSocketL()
Returns current value of the timeout
Since
Series60 3.2
Since
Series60 3.2

DeleteServeFileL()

voidDeleteServeFileL()[pure virtual]
Callback function. Deletes fileserve of this session.
Since
Series60 2.6

DeleteThisSessionL(CUpnpTcpSession *)

voidDeleteThisSessionL(CUpnpTcpSession *aSession)[pure virtual]
Callback function. Deletes given session.
Since
Series60 2.6

Parameters

CUpnpTcpSession * aSessionSession to delete.

DestroyIt(CUpnpTcpSession *)

voidDestroyIt(CUpnpTcpSession *aSession)[protected, pure virtual]

Parameters

CUpnpTcpSession * aSession

DisconnectRequestL()

voidDisconnectRequestL()
Handles disconnect request
Since
Series60 3.2

DownloadOngoing()

TBool DownloadOngoing()
Checks if there are outstanding sending operations.
Since
Series60 3.2

FileAccess()

CUpnpHttpFileAccess *FileAccess()[pure virtual]
Returns a pointer to FileAccess object of this session.
Since
Series60 3.2

FileServeExists()

TBool FileServeExists()[pure virtual]
Checks if FileServe Exists.
Since
Series60 2.6

FileTransferReader()

CUpnpHttpFileTransferReader *FileTransferReader()
Returns pointer to CUpnpHttpFileTransferReader
Since
Series60 3.2

FileTransferReaderConstructL()

voidFileTransferReaderConstructL()[protected]
Contructs file transfer reader
Since
Series60 3.2

FileTransferReaderDoneL()

voidFileTransferReaderDoneL()[pure virtual]
Callback function. Notifies http session when upload finished
Since
Series60 3.2

FileTransferReaderErrorL(TInt)

voidFileTransferReaderErrorL(TIntaError)[pure virtual]
Callback function. Notifies http session when error in upload
Since
Series60 3.2

Parameters

TInt aError

FileTransferWriter()

CUpnpHttpFileTransferWriter *FileTransferWriter()
Returns pointer to CUpnpHttpFileTransferWriter
Since
Series60 3.2

FileTransferWriterConstructL(TInt)

voidFileTransferWriterConstructL(TIntaWriteSize)[protected]
Contructs file transfer writer
Since
Series60 3.2

Parameters

TInt aWriteSize

FileTransferWriterDoneL()

voidFileTransferWriterDoneL()[pure virtual]
Callback function. Notifies http session when download finished
Since
Series60 3.2

FileTransferWriterHandleMoreL()

voidFileTransferWriterHandleMoreL()[pure virtual]
Callback function. Checks for outstanding downloads
Since
Series60 3.2

HandleErrorL(TInt)

voidHandleErrorL(TIntaError)
Handles possible error that can occure in the session as well as in reader and writer active objects.
Since
Series60 3.0

Parameters

TInt aErrorerror code

Id()

TInt Id()
Returns the SessionId of this session.
Since
Series60 3.1

InitialReceiveL()

voidInitialReceiveL()
Starts to receive messages to this session
Since
Series60 3.2

IsConnected()

TBool IsConnected()
Checks is session is connected.
Since
Series60 2.6

IsPersistentConnection()

TBool IsPersistentConnection()
Marked if a persistent connection
Since
Series60 3.2

NotifyDisconnectL(TInetAddr)

voidNotifyDisconnectL(TInetAddraAddr)[pure virtual]
Callback function. Notifies upper layers that session has been disconnected.
Since
Series60 2.6

Parameters

TInetAddr aAddrAddress of remote host.

NotifyTimeoutL()

voidNotifyTimeoutL()[pure virtual]

NotifyUpperLayersOnPostL()

voidNotifyUpperLayersOnPostL()[pure virtual]
Callback function. Informs upper layers that HTTP POST has been started by sending HTTP error code 801 message to upper layers.
Since
Series60 2.6

OutstandingWritings()

TBool OutstandingWritings()[private]
Checks if there are outstanding writing operations.
Since
Series60 3.2

PostingFileCompleteL()

voidPostingFileCompleteL()[pure virtual]
Callback function. Informs upper layers that HTTP POST has been finished
Since
Series60 2.6

ReceiveL()

voidReceiveL()
Receive messages to this session
Since
Series60 3.2

ReceivingCompletedL(TDesC8 &)

voidReceivingCompletedL(TDesC8 &aBuffer)
Callback function for reader object. When the reader gets some data, it forwards it to the session with this callback.
Since
Series60 3.0

Parameters

TDesC8 & aBufferbuffer with received data.

RemoteHost()

TInetAddr &RemoteHost()
Returns the address that session is connected to.
Since
Series60 2.6

ServerBusyL()

voidServerBusyL()
Function that is used to send notification to client and disconnect the session.
Since
Series60 2.6

ServerPort()

TInt ServerPort()[pure virtual]
Callback function. Returns the port number of parent HttpServer.
Since
Series60 2.6

SetState(TUpnpTcpSessionState)

voidSetState(TUpnpTcpSessionStateaState)[private]
Sets session statel.
Since
Series60 2.6

Parameters

TUpnpTcpSessionState aStatenew state of the session.

ShutdownStop()

voidShutdownStop()

ShuttingDown()

TBool ShuttingDown()
Checks if the session is being shutdown
Since
Series60 3.2

SocketServerBusyL(const TInetAddr &)

voidSocketServerBusyL(const TInetAddr &aAddr)[pure virtual]
Callback function. Notifies upper layers that SocketServer is busy.
Since
Series60 2.6

Parameters

const TInetAddr & aAddrAddress of remote host.

StartClosingSession()

voidStartClosingSession()
Starts closing the session, no more message to be sent to the client
Since
Series60 3.2

StartDisconnect(TBool)

voidStartDisconnect(TBoolaDisconnectNotification = EFalse)
Starts disconnect session.
Since
Series60 3.2

Parameters

TBool aDisconnectNotification = EFalse

StartDisconnectingTimer(TInt)

voidStartDisconnectingTimer(TIntaTime = 500)
Starts the timeoutTimer for session. Session is deleted after 0.5ms by default.
Since
Series60 2.6

Parameters

TInt aTime = 500

StartTimeoutTimer(TBool)

voidStartTimeoutTimer(TBoolaSessionErrorReplyNeeded)
Starts the timeoutTimer for session. If timer expires, no reply has been sent to remote host.
Since
Series60 2.6

Parameters

TBool aSessionErrorReplyNeededETrue, if in timeout there should be sent HTTP error 408 Server timeout.

TcpConstructL(RSocket, TInt, TInt)

voidTcpConstructL(RSocketaSocket,
TIntaReadBufferSize,
TIntaFileReadBufferSize
)

Second phase constructor for building CUpnpTcpSession. This constructor is used when connection is iniatiated from network.

Parameters

RSocket aSocketPointer to new Socket which is already connected to remote host.
TInt aReadBufferSize
TInt aFileReadBufferSize

TimeoutCurrentValue()

TInt TimeoutCurrentValue()

TimerCancel()

voidTimerCancel()
Cancel timer
Since
Series60 3.2

TimerEventL(CUpnpNotifyTimer *)

voidTimerEventL(CUpnpNotifyTimer *aTimer)
Callback function for timer expirations.
Since
Series60 2.6

Parameters

CUpnpNotifyTimer * aTimerTimer that has expired.

WaitRetryError(TInt, TBool)

voidWaitRetryError(TIntaError,
TBoolaStartTimer = EFalse
)
Callback function for writer object. When the request writing is not completed due to an error, a new attempt to write is being made...
Since
Series60 3.2

Parameters

TInt aError
TBool aStartTimer = EFalse

WriteL(const TDesC8 &)

voidWriteL(const TDesC8 &aBuffer)
Writes data thru this session's socket
Since
Series60 2.6

Parameters

const TDesC8 & aBufferData to write.

WritingCompletedL()

voidWritingCompletedL()
Callback function for writer object. When the request writing is completed then writer calls this function to notify session about it.
Since
Series60 3.0

Member Enumerations Documentation

Enum TUpnpTcpSessionState

State of session.
  • EnotConnected - Connection is not established yet.

  • EConnecting - TcpSession requested connection in asynchronous mode.

  • EConnected - Connection is established, TcpReader is started and TcpWriter can write to the socket.

  • EDisconnecting - Session is about to be disconnected but socket is not closed so TcpWriter can still write a response.

  • EServerBusy - Server is already occupied with processing requests so no other session can be established.

Enumerators

ENotConnected
EConnecting
EConnected
EDisconnecting
EShuttingDownWriteWait
EShuttingDownStop
EShuttingDown
EServerBusy

Member Data Documentation

TInetAddr iAddr

TInetAddr iAddr[protected]

TBool iContinuedMessageDownload

TBool iContinuedMessageDownload[protected]

TBool iDisconnectNotification

TBool iDisconnectNotification[protected]

TInt iExportRetryCounter

TInt iExportRetryCounter[protected]

CUpnpHttpFileTransferReader * iFTReader

CUpnpHttpFileTransferReader *iFTReader[protected]

CUpnpHttpFileTransferWriter * iFTWriter

CUpnpHttpFileTransferWriter *iFTWriter[protected]

TInt iFileReadBufferSize

TInt iFileReadBufferSize[protected]

TInt iId

TInt iId[protected]

TThreadPriority iInitialPriority

TThreadPriority iInitialPriority[protected]

TBool iIsPersistent

TBool iIsPersistent[protected]

TBool iPendingPostRequests

TBool iPendingPostRequests[protected]

CUpnpHttpBuffer * iReceivedMessage

CUpnpHttpBuffer *iReceivedMessage[protected]

TBool iSaveToFile

TBool iSaveToFile[protected]

TInt iSessionError

TInt iSessionError[protected]

TBool iSessionKeepAlive

TBool iSessionKeepAlive[protected]

TBool iSessionNeedsErrorReply

TBool iSessionNeedsErrorReply[protected]

RSocket iSocket

RSocket iSocket[protected]

CUpnpSocketShutdown * iSocketShutdown

CUpnpSocketShutdown *iSocketShutdown[protected]

TUpnpTcpSessionState iState

TUpnpTcpSessionState iState[protected]

CUpnpTcpSessionReader * iTcpReader

CUpnpTcpSessionReader *iTcpReader[protected]

CUpnpTcpSessionWriter * iTcpWriter

CUpnpTcpSessionWriter *iTcpWriter[protected]

TInt iTimeoutCurrentValue

TInt iTimeoutCurrentValue[protected]

TInt iTimeoutSessionValue

TInt iTimeoutSessionValue[protected]

CUpnpNotifyTimer * iTimeoutTimer

CUpnpNotifyTimer *iTimeoutTimer[protected]