kerneltest/e32test/usb/t_usb_device/src/tranhandleserver.cpp
author hgs
Thu, 01 Jul 2010 17:57:33 +0100
changeset 189 a5496987b1da
child 253 d37db4dcc88d
permissions -rw-r--r--
201025_04

/*
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/

/**
 @file
 @internalComponent
*/


#include "tranhandleserver.h"
#include "tranhandlesession.h"
#include "tranhandleserversecuritypolicy.h"
#include "tranhandleserverconsts.h"
#include "general.h"



CTranHandleServer* CTranHandleServer::NewL(CActiveControl& aControl)
    {
    RDebug::Printf("CTranHandleServer::NewL");
    CTranHandleServer* self = new(ELeave) CTranHandleServer(aControl);
    CleanupStack::PushL(self);
    TInt err = self->Start(KTranHandleServerName);

    if ( err != KErrAlreadyExists )
        {
        User::LeaveIfError(err);
        }
    CleanupStack::Pop(self);
    return self;
    }

CTranHandleServer::~CTranHandleServer()
    {
    RDebug::Printf("CTranHandleServer::~CTranHandleServer");
    }

CTranHandleServer::CTranHandleServer(CActiveControl& aControl)
 :  CPolicyServer(CActive::EPriorityStandard, KTranHandleServerPolicy, ESharableSessions),
    iActiveControl(aControl)
    {
    }

CSession2* CTranHandleServer::NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const
    {
    //Validate session as coming from UsbSvr
	RDebug::Printf("CTranHandleServer::NewSessionL");
    CTranHandleSession* sess = CTranHandleSession::NewL(iActiveControl);
    return sess;
    }