upnp/upnpstack/upnpconnmanager/src/upnpconnmanager.cpp
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 /** @file
       
     2 * Copyright (c) 2005-2006 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 "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:  class CUpnpConnectionManager
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include "upnpconnmanager.h"
       
    20 #define KLogFile _L("UPnPConnManager.txt")
       
    21 #include "upnpcustomlog.h"
       
    22 #include "upnpconnmanagerengine.h"
       
    23 #include "upnpconnmanagersession.h"
       
    24 
       
    25 const TVersion KServerSupportedVersion(
       
    26     KUpnpConnectionManagerMajorVersionNumber,
       
    27     KUpnpConnectionManagerMinorVersionNumber,
       
    28     KUpnpConnectionManagerBuildVersionNumber );
       
    29 
       
    30 // ================= MEMBER FUNCTIONS =======================
       
    31 
       
    32 // -----------------------------------------------------------------------------
       
    33 // CUpnpConnectionManager::CUpnpConnectionManager
       
    34 // C++ default constructor can NOT contain any code, that
       
    35 // might leave.
       
    36 // -----------------------------------------------------------------------------
       
    37 //
       
    38 CUpnpConnectionManager::CUpnpConnectionManager()
       
    39     {
       
    40     }
       
    41 
       
    42 // -----------------------------------------------------------------------------
       
    43 // CUpnpConnectionManager::~CUpnpConnectionManager
       
    44 // Destructor.
       
    45 // -----------------------------------------------------------------------------
       
    46 //
       
    47 CUpnpConnectionManager::~CUpnpConnectionManager()
       
    48     {
       
    49     delete iEngine;
       
    50     }
       
    51 
       
    52 // -----------------------------------------------------------------------------
       
    53 // CUpnpConnectionManager::NewLC
       
    54 // Two-phased constructor.
       
    55 // -----------------------------------------------------------------------------
       
    56 //
       
    57 CUpnpSymbianServerBase* CUpnpConnectionManager::NewLC()
       
    58     {
       
    59     LOG_FUNC_NAME;
       
    60     CUpnpConnectionManager* connManager = new (ELeave) CUpnpConnectionManager();
       
    61     CleanupStack::PushL( connManager );
       
    62     connManager->ConstructL() ;
       
    63     return connManager;
       
    64     }
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // CUpnpConnectionManager::ConstructL
       
    68 // Symbian 2nd phase constructor can leave.
       
    69 // -----------------------------------------------------------------------------
       
    70 //
       
    71 void CUpnpConnectionManager::ConstructL()
       
    72     {
       
    73     LOG_FUNC_NAME;
       
    74     BaseConstructL();
       
    75     iEngine = CUpnpConnManagerEngine::NewL( iSessionIter );
       
    76     }
       
    77 
       
    78 // -----------------------------------------------------------------------------
       
    79 // CUpnpConnectionManager::NewSessionL
       
    80 // Create new session.
       
    81 // -----------------------------------------------------------------------------
       
    82 //
       
    83 CSession2* CUpnpConnectionManager::NewSessionL( const RMessage2& /*aMsg*/ ) const
       
    84     {
       
    85     LOG_FUNC_NAME;
       
    86     return CUpnpConnManagerSession::NewL( *iEngine );
       
    87     }
       
    88 
       
    89 // -----------------------------------------------------------------------------
       
    90 // CUpnpConnectionManager::SupportedVersion
       
    91 // Gets server supported version.
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 TVersion CUpnpConnectionManager::SupportedVersion() const
       
    95     {
       
    96     return KServerSupportedVersion;
       
    97     }
       
    98 
       
    99 // -----------------------------------------------------------------------------
       
   100 // CUpnpConnectionManager::ServerName
       
   101 // Gets server supported version.
       
   102 // -----------------------------------------------------------------------------
       
   103 //
       
   104 const TDesC& CUpnpConnectionManager::ServerName() const
       
   105     {
       
   106     return KUpnpConnectionManagerName;
       
   107     }
       
   108 
       
   109 // -----------------------------------------------------------------------------
       
   110 // CUpnpConnectionManager::RunError
       
   111 // RunError is called when RunL leaves.
       
   112 // -----------------------------------------------------------------------------
       
   113 //
       
   114 TInt CUpnpConnectionManager::RunError( TInt aError )
       
   115     {
       
   116     LOG_FUNC_NAME;
       
   117     return CUpnpSymbianServerBase::RunError( aError );
       
   118     }
       
   119 
       
   120 // ============================= LOCAL FUNCTIONS ===============================
       
   121 
       
   122 // -----------------------------------------------------------------------------
       
   123 // E32Main entry point.
       
   124 // -----------------------------------------------------------------------------
       
   125 //
       
   126 TInt E32Main()
       
   127     {
       
   128     return CUpnpConnectionManager::StartServer(
       
   129         KUpnpConnectionManagerThreadName, CUpnpConnectionManager::NewLC );
       
   130     }
       
   131 
       
   132 // End of File
       
   133