authenticationservices/authenticationserver/source/server/authmain.cpp
changeset 29 ece3df019add
equal deleted inserted replaced
19:cd501b96611d 29:ece3df019add
       
     1 /*
       
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * AuthServer startup code implementation
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file 
       
    22 */
       
    23 
       
    24 #include "authserver_impl.h"
       
    25 
       
    26 using namespace AuthServer;
       
    27 
       
    28 namespace
       
    29 {
       
    30 
       
    31 /**
       
    32  * Perform all server initialisation, in particular creation of the
       
    33  * scheduler and server and then run the scheduler
       
    34  */
       
    35 static CScsServer* NewAuthServerLC()
       
    36 /**
       
    37 	This factory function is called by SCS.  It allocates
       
    38 	the server object and leaves it on the cleanup stack.
       
    39 
       
    40 	@return					New initialized instance of CScsTestServer.
       
    41 							On return this is on the cleanup stack.
       
    42  */
       
    43 	{
       
    44 	return AuthServer::CAuthServer::NewLC();
       
    45 	}
       
    46 
       
    47 }
       
    48 
       
    49 /**
       
    50  * Server process entry-point
       
    51  **/
       
    52 TInt E32Main()
       
    53 	{
       
    54 	TInt err = StartScsServer(NewAuthServerLC);
       
    55 
       
    56 	/**
       
    57      *  err can either be KErrNone (AuthServer is started successfully) or  
       
    58      *  KErrAlreadyExists(AuthServer is currently running). Panic for all other
       
    59      *  cases.
       
    60 	 **/
       
    61 		
       
    62 	__ASSERT_DEBUG(err == KErrNone || err == KErrAlreadyExists, User::Panic(KAuthServerShortName, err));
       
    63 	return err;
       
    64 	}
       
    65