os/security/cryptomgmtlibs/securitycommonutils/test/source/scstestserver/scstestserver.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/cryptomgmtlibs/securitycommonutils/test/source/scstestserver/scstestserver.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,97 @@
     1.4 +/*
     1.5 +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +* Implements CScsTestServer.  See class and function definitions
    1.19 +* for more information.
    1.20 +*
    1.21 +*/
    1.22 +
    1.23 +
    1.24 +/**
    1.25 + @file
    1.26 +*/
    1.27 +#include <f32file.h>
    1.28 +#include "scstestserver.h"
    1.29 +#include "scstestclient.h"
    1.30 +
    1.31 +
    1.32 +CScsTestServer* CScsTestServer::NewLC()
    1.33 +/**
    1.34 +	Factory function allocates a new, initialized instance of CScsTestServer.
    1.35 +
    1.36 +	@return					New instance of CScsTestServer, which is owned by the
    1.37 +							caller and left on the cleanup stack.  On return, the
    1.38 +							server has been started.
    1.39 + */
    1.40 +	{
    1.41 +	CScsTestServer* self = new(ELeave) CScsTestServer();
    1.42 +	CleanupStack::PushL(self);
    1.43 +	RFs fs;
    1.44 +	User::LeaveIfError(fs.Connect());
    1.45 +	TUint attr;
    1.46 +	TInt r = fs.Att(KDisableScsTestServerTimeout(), attr);
    1.47 +	if(r == KErrNone)
    1.48 +		{
    1.49 +		self->ConstructL(0);
    1.50 +		}
    1.51 +	else
    1.52 +		{
    1.53 +		self->ConstructL(ScsTestImpl::KShutdownPeriodUs);
    1.54 +		}
    1.55 +	return self;
    1.56 +	}
    1.57 +
    1.58 +CScsTestServer::CScsTestServer()
    1.59 +/**
    1.60 +	This private constructor prevents direct instantiation.
    1.61 + */
    1.62 + :	CScsServer(ScsTestImpl::Version())
    1.63 +	{
    1.64 +	// empty.
    1.65 +	}
    1.66 +
    1.67 +void CScsTestServer::ConstructL(TInt aShutdownPeriodUs)
    1.68 +/**
    1.69 +	Secondary initialization initializes the base class and
    1.70 +	starts the server.
    1.71 + */
    1.72 +	{
    1.73 +	CScsServer::ConstructL(aShutdownPeriodUs);
    1.74 +	StartL(ScsTestImpl::KServerName);
    1.75 +	}
    1.76 +
    1.77 +CScsTestServer::~CScsTestServer()
    1.78 +/**
    1.79 +	This empty constructor provides a single point of definition.
    1.80 + */
    1.81 +	{
    1.82 +	// empty.
    1.83 +	}
    1.84 +
    1.85 +CScsSession* CScsTestServer::DoNewSessionL(const RMessage2& aMessage)
    1.86 +/**
    1.87 +	Implement CSessionCountServer by allocating a new instance of CScsSession.
    1.88 +
    1.89 +	@param	aMessage		Connect message.  Not used.
    1.90 +	@return					New, initialized instance of CScsTestSession.
    1.91 +							This object will be destroyed by the framework
    1.92 +							when the session is closed.
    1.93 + */
    1.94 +	{
    1.95 +	(void) aMessage;
    1.96 +
    1.97 +	return CScsTestSession::NewL(*this);
    1.98 +	}
    1.99 +
   1.100 +// End of file