sl@0: /* sl@0: * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * Implements CScsTestServer. See class and function definitions sl@0: * for more information. sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: */ sl@0: #include sl@0: #include "scstestserver.h" sl@0: #include "scstestclient.h" sl@0: sl@0: sl@0: CScsTestServer* CScsTestServer::NewLC() sl@0: /** sl@0: Factory function allocates a new, initialized instance of CScsTestServer. sl@0: sl@0: @return New instance of CScsTestServer, which is owned by the sl@0: caller and left on the cleanup stack. On return, the sl@0: server has been started. sl@0: */ sl@0: { sl@0: CScsTestServer* self = new(ELeave) CScsTestServer(); sl@0: CleanupStack::PushL(self); sl@0: RFs fs; sl@0: User::LeaveIfError(fs.Connect()); sl@0: TUint attr; sl@0: TInt r = fs.Att(KDisableScsTestServerTimeout(), attr); sl@0: if(r == KErrNone) sl@0: { sl@0: self->ConstructL(0); sl@0: } sl@0: else sl@0: { sl@0: self->ConstructL(ScsTestImpl::KShutdownPeriodUs); sl@0: } sl@0: return self; sl@0: } sl@0: sl@0: CScsTestServer::CScsTestServer() sl@0: /** sl@0: This private constructor prevents direct instantiation. sl@0: */ sl@0: : CScsServer(ScsTestImpl::Version()) sl@0: { sl@0: // empty. sl@0: } sl@0: sl@0: void CScsTestServer::ConstructL(TInt aShutdownPeriodUs) sl@0: /** sl@0: Secondary initialization initializes the base class and sl@0: starts the server. sl@0: */ sl@0: { sl@0: CScsServer::ConstructL(aShutdownPeriodUs); sl@0: StartL(ScsTestImpl::KServerName); sl@0: } sl@0: sl@0: CScsTestServer::~CScsTestServer() sl@0: /** sl@0: This empty constructor provides a single point of definition. sl@0: */ sl@0: { sl@0: // empty. sl@0: } sl@0: sl@0: CScsSession* CScsTestServer::DoNewSessionL(const RMessage2& aMessage) sl@0: /** sl@0: Implement CSessionCountServer by allocating a new instance of CScsSession. sl@0: sl@0: @param aMessage Connect message. Not used. sl@0: @return New, initialized instance of CScsTestSession. sl@0: This object will be destroyed by the framework sl@0: when the session is closed. sl@0: */ sl@0: { sl@0: (void) aMessage; sl@0: sl@0: return CScsTestSession::NewL(*this); sl@0: } sl@0: sl@0: // End of file