CUpnpSymbianServerBase Class Reference

class CUpnpSymbianServerBase : public CServer2
Base class for all symbian server classes used in upnp stack project This implementation provides:

upnpipserversutils

Inherits from

Public Member Functions
~CUpnpSymbianServerBase ()
IMPORT_C void PanicClient (const RMessage2 &, TInt )
IMPORT_C TInt StartServer (const TDesC &, TServerFactoryMethodLC )
Protected Member Functions
CUpnpSymbianServerBase ()
IMPORT_C void BaseConstructL ()
IMPORT_C CSession2 * NewSessionL (const TVersion &, const RMessage2 &)
IMPORT_C void PanicServer ( TInt )
IMPORT_C TInt RunError ( TInt )
IMPORT_C void RunL ()
IMPORT_C void SuggestShutdown ()
IMPORT_C void TimerEventL ( CUpnpNotifyTimer *)
Private Member Functions
IMPORT_C TBool CanBeStopped ()
void DecrementSessionCount ()
void IncrementSessionCount ()
CSession2 * NewSessionL (const RMessage2 &)
const TDesC & ServerName ()
void StartServerL (const TDesC &, TServerFactoryMethodLC )
TVersion SupportedVersion ()
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
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()
CServer2::CServer2(TInt,TServerType)
CServer2::DoCancel()
CServer2::DoConnect(const RMessage2 &)
CServer2::Extension_(TUint,TAny *&,TAny *)
CServer2::Message()const
CServer2::ReStart()
CServer2::Server()const
CServer2::SetMaster(const CServer2 *)
CServer2::SetPinClientDescriptors(TBool)
CServer2::Start(const TDesC &)
CServer2::StartL(const TDesC &)
CServer2::~CServer2()
Public Member Enumerations
enum TUpnpSymbianServerPanics { ECreateTrapCleanup , EBadRequest , EBadDescriptor , EFirstUnusedPanicNumber }
Inherited Enumerations
CActive:TPriority
CServer2:TPanic
CServer2:TServerType
Private Attributes
TInt iSessionCount
CUpnpNotifyTimer * iShutdownTimer
Inherited Attributes
CActive::iStatus
CServer2::iSessionIter

Constructor & Destructor Documentation

CUpnpSymbianServerBase()

IMPORT_C CUpnpSymbianServerBase ( ) [protected]

Constructor.

~CUpnpSymbianServerBase()

IMPORT_C ~CUpnpSymbianServerBase ( )

Destructor

Member Functions Documentation

BaseConstructL()

IMPORT_C void BaseConstructL ( ) [protected]

Second phase base constructor. It must be called by derived class.

CanBeStopped()

IMPORT_C TBool CanBeStopped ( ) const [private, virtual]

Derived classes can implement in the method additional condidions of stopping server process that will be checked in SuggestShutdown method and befor actual server stopping. Default implementation provides no additional condidions.

DecrementSessionCount()

void DecrementSessionCount ( ) [private]

Decrement the count of the active sessions for this server.

IncrementSessionCount()

void IncrementSessionCount ( ) [private]

Increment the count of the active sessions for this server.

NewSessionL(const RMessage2 &)

CSession2 * NewSessionL ( const RMessage2 & aMessage ) const [private, pure virtual]

Returns new CSession2 object. This method don't have to bother about version checking as this is done by implementation of CUpnpSymbianServerBase::NewSessionL (const TVersion & aVersion, const RMessage2 & aMessage) that is wrapping this method.

Parameters

const RMessage2 & aMessage

NewSessionL(const TVersion &, const RMessage2 &)

IMPORT_C CSession2 * NewSessionL ( const TVersion & aVersion,
const RMessage2 & aMessage
) const [protected, virtual]

This method wraps pure virtual NewSessionL(const RMessage2&) and leaves with KErrNotSupported if aVersion is different from version provided by pure virtual SupportedVersion.

Parameters

const TVersion & aVersion
const RMessage2 & aMessage

PanicClient(const RMessage2 &, TInt)

IMPORT_C void PanicClient ( const RMessage2 & aMessage,
TInt aReason
) const

Panic the client.

Parameters

const RMessage2 & aMessage the message channel to the client.
TInt aReason the reason code for the panic.

PanicServer(TInt)

IMPORT_C void PanicServer ( TInt aPanic ) const [protected]

Panic the server.

Parameters

TInt aPanic the panic code.

RunError(TInt)

IMPORT_C TInt RunError ( TInt aError ) [protected, virtual]

Process any errors.

Parameters

TInt aError the leave code reported.

RunL()

IMPORT_C void RunL ( ) [protected, virtual]

Invoked by active object framework to handle ending events

ServerName()

const TDesC & ServerName ( ) const [private, pure virtual]

Return name of a server.

StartServer(const TDesC &, TServerFactoryMethodLC)

IMPORT_C TInt StartServer ( const TDesC & aThreadName,
TServerFactoryMethodLC aServerFactoryMethodLC
) [static]

Fully initialise thread, and start the server. Method is intended to be called from E32Main method without any earlier initialisation.

Parameters

const TDesC & aThreadName name to which thread will be renamed.
TServerFactoryMethodLC aServerFactoryMethodLC two phase constructor of server object that leaves it on cleanup stack.

StartServerL(const TDesC &, TServerFactoryMethodLC)

void StartServerL ( const TDesC & aThreadName,
TServerFactoryMethodLC aServerFactoryMethodLC
) [private, static]

Internal method that initialises thread, and starts the server. Precondition is that cleanup stack is correctly initialised and method is called from within a TRAP.

Parameters

const TDesC & aThreadName name to which thread will be renamed.
TServerFactoryMethodLC aServerFactoryMethodLC two phase constructor of server object that leaves it on cleanup stack.

SuggestShutdown()

IMPORT_C void SuggestShutdown ( ) [protected]

Method should be called when derived class wants to suggest closing of the media server. This method checks every stop condidion and starts closing server timeout if all of them are fulfilled.

SupportedVersion()

TVersion SupportedVersion ( ) const [private, pure virtual]

Returns version that is supported by this server.

TimerEventL(CUpnpNotifyTimer *)

IMPORT_C void TimerEventL ( CUpnpNotifyTimer * aTimer ) [protected, virtual]

Invoked by shutdown timer when event TimerEventL occured.

Parameters

CUpnpNotifyTimer * aTimer

Member Enumerations Documentation

Enum TUpnpSymbianServerPanics

Enumerators

ECreateTrapCleanup
EBadRequest
EBadDescriptor
EFirstUnusedPanicNumber

Member Data Documentation

TInt iSessionCount

TInt iSessionCount [private]

CUpnpNotifyTimer * iShutdownTimer

CUpnpNotifyTimer * iShutdownTimer [private]

shutdown timer