author | sl |
Tue, 10 Jun 2014 14:32:02 +0200 | |
changeset 1 | 260cb5ec6c19 |
permissions | -rw-r--r-- |
sl@0 | 1 |
/* |
sl@0 | 2 |
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
sl@0 | 3 |
* All rights reserved. |
sl@0 | 4 |
* This component and the accompanying materials are made available |
sl@0 | 5 |
* under the terms of the License "Eclipse Public License v1.0" |
sl@0 | 6 |
* which accompanies this distribution, and is available |
sl@0 | 7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
sl@0 | 8 |
* |
sl@0 | 9 |
* Initial Contributors: |
sl@0 | 10 |
* Nokia Corporation - initial contribution. |
sl@0 | 11 |
* |
sl@0 | 12 |
* Contributors: |
sl@0 | 13 |
* |
sl@0 | 14 |
* Description: |
sl@0 | 15 |
* Implements CScsTestServer. See class and function definitions |
sl@0 | 16 |
* for more information. |
sl@0 | 17 |
* |
sl@0 | 18 |
*/ |
sl@0 | 19 |
|
sl@0 | 20 |
|
sl@0 | 21 |
/** |
sl@0 | 22 |
@file |
sl@0 | 23 |
*/ |
sl@0 | 24 |
#include <f32file.h> |
sl@0 | 25 |
#include "scstestserver.h" |
sl@0 | 26 |
#include "scstestclient.h" |
sl@0 | 27 |
|
sl@0 | 28 |
|
sl@0 | 29 |
CScsTestServer* CScsTestServer::NewLC() |
sl@0 | 30 |
/** |
sl@0 | 31 |
Factory function allocates a new, initialized instance of CScsTestServer. |
sl@0 | 32 |
|
sl@0 | 33 |
@return New instance of CScsTestServer, which is owned by the |
sl@0 | 34 |
caller and left on the cleanup stack. On return, the |
sl@0 | 35 |
server has been started. |
sl@0 | 36 |
*/ |
sl@0 | 37 |
{ |
sl@0 | 38 |
CScsTestServer* self = new(ELeave) CScsTestServer(); |
sl@0 | 39 |
CleanupStack::PushL(self); |
sl@0 | 40 |
RFs fs; |
sl@0 | 41 |
User::LeaveIfError(fs.Connect()); |
sl@0 | 42 |
TUint attr; |
sl@0 | 43 |
TInt r = fs.Att(KDisableScsTestServerTimeout(), attr); |
sl@0 | 44 |
if(r == KErrNone) |
sl@0 | 45 |
{ |
sl@0 | 46 |
self->ConstructL(0); |
sl@0 | 47 |
} |
sl@0 | 48 |
else |
sl@0 | 49 |
{ |
sl@0 | 50 |
self->ConstructL(ScsTestImpl::KShutdownPeriodUs); |
sl@0 | 51 |
} |
sl@0 | 52 |
return self; |
sl@0 | 53 |
} |
sl@0 | 54 |
|
sl@0 | 55 |
CScsTestServer::CScsTestServer() |
sl@0 | 56 |
/** |
sl@0 | 57 |
This private constructor prevents direct instantiation. |
sl@0 | 58 |
*/ |
sl@0 | 59 |
: CScsServer(ScsTestImpl::Version()) |
sl@0 | 60 |
{ |
sl@0 | 61 |
// empty. |
sl@0 | 62 |
} |
sl@0 | 63 |
|
sl@0 | 64 |
void CScsTestServer::ConstructL(TInt aShutdownPeriodUs) |
sl@0 | 65 |
/** |
sl@0 | 66 |
Secondary initialization initializes the base class and |
sl@0 | 67 |
starts the server. |
sl@0 | 68 |
*/ |
sl@0 | 69 |
{ |
sl@0 | 70 |
CScsServer::ConstructL(aShutdownPeriodUs); |
sl@0 | 71 |
StartL(ScsTestImpl::KServerName); |
sl@0 | 72 |
} |
sl@0 | 73 |
|
sl@0 | 74 |
CScsTestServer::~CScsTestServer() |
sl@0 | 75 |
/** |
sl@0 | 76 |
This empty constructor provides a single point of definition. |
sl@0 | 77 |
*/ |
sl@0 | 78 |
{ |
sl@0 | 79 |
// empty. |
sl@0 | 80 |
} |
sl@0 | 81 |
|
sl@0 | 82 |
CScsSession* CScsTestServer::DoNewSessionL(const RMessage2& aMessage) |
sl@0 | 83 |
/** |
sl@0 | 84 |
Implement CSessionCountServer by allocating a new instance of CScsSession. |
sl@0 | 85 |
|
sl@0 | 86 |
@param aMessage Connect message. Not used. |
sl@0 | 87 |
@return New, initialized instance of CScsTestSession. |
sl@0 | 88 |
This object will be destroyed by the framework |
sl@0 | 89 |
when the session is closed. |
sl@0 | 90 |
*/ |
sl@0 | 91 |
{ |
sl@0 | 92 |
(void) aMessage; |
sl@0 | 93 |
|
sl@0 | 94 |
return CScsTestSession::NewL(*this); |
sl@0 | 95 |
} |
sl@0 | 96 |
|
sl@0 | 97 |
// End of file |