|
1 /* |
|
2 * Copyright (c) 2005 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: DS Host Server 2 |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <s32mem.h> |
|
21 #include <nsmldebug.h> |
|
22 |
|
23 #include "nsmldshostconstants.h" |
|
24 #include "nsmlhostserver2.h" |
|
25 |
|
26 // ======================================= MEMBER FUNCTIONS ======================================= |
|
27 |
|
28 // ------------------------------------------------------------------------------------------------ |
|
29 // CNSmlDSHostServer2::NewL |
|
30 // ------------------------------------------------------------------------------------------------ |
|
31 // |
|
32 CNSmlDSHostServer2* CNSmlDSHostServer2::NewL( const TDesC& aServerName ) |
|
33 { |
|
34 _DBG_FILE( "CNSmlDSHostServer2::NewL(): begin" ); |
|
35 CNSmlDSHostServer2 *pS = new ( ELeave ) CNSmlDSHostServer2(); |
|
36 CleanupStack::PushL( pS ); |
|
37 pS->StartL( aServerName ); |
|
38 CleanupStack::Pop(); // pS |
|
39 _DBG_FILE( "CNSmlDSHostServer2::NewL(): end" ); |
|
40 return pS; |
|
41 } |
|
42 |
|
43 // ------------------------------------------------------------------------------------------------ |
|
44 // CNSmlDSHostServer2::~CNSmlDSHostServer2 |
|
45 // ------------------------------------------------------------------------------------------------ |
|
46 // |
|
47 CNSmlDSHostServer2::~CNSmlDSHostServer2() |
|
48 { |
|
49 _DBG_FILE( "CNSmlDSHostServer2::~CNSmlDSHostServer2(): begin" ); |
|
50 _DBG_FILE( "CNSmlDSHostServer2::~CNSmlDSHostServer2(): end" ); |
|
51 } |
|
52 |
|
53 // ------------------------------------------------------------------------------------------------ |
|
54 // CNSmlDSHostServer2::LaunchServer |
|
55 // ------------------------------------------------------------------------------------------------ |
|
56 // |
|
57 TInt CNSmlDSHostServer2::LaunchServer( TAny* ) |
|
58 { |
|
59 return InitHostServer( ENSmlHostServer2, ( TThreadFunction ) ThreadFunctionL ); |
|
60 } |
|
61 |
|
62 // ------------------------------------------------------------------------------------------------ |
|
63 // CNSmlDSHostServer2::ThreadFunctionL |
|
64 // ------------------------------------------------------------------------------------------------ |
|
65 // |
|
66 TInt CNSmlDSHostServer2::ThreadFunctionL( TAny* /*aStarted*/ ) |
|
67 { |
|
68 CNSmlDSHostServer2* hs = NULL; |
|
69 TRAPD( err, hs = CNSmlDSHostServer2::NewL( KNSmlDSHostServer2Name() ) ); |
|
70 RProcess::Rendezvous( err ); |
|
71 CActiveScheduler::Start(); |
|
72 delete hs; |
|
73 |
|
74 return KErrNone; |
|
75 } |
|
76 |
|
77 // ------------------------------------------------------------------------------------------------ |
|
78 // CNSmlDSHostServer2::PanicServer |
|
79 // ------------------------------------------------------------------------------------------------ |
|
80 // |
|
81 void CNSmlDSHostServer2::PanicServer( TNSmlHostServerErrors aPanic ) |
|
82 { |
|
83 _LIT( KTxtDSHostServer2,"NSmlDSHostServer2" ); |
|
84 User::Panic( KTxtDSHostServer2, aPanic ); |
|
85 } |
|
86 |
|
87 // ------------------------------------------------------------------------------------------------ |
|
88 // CNSmlDSHostServer2::CNSmlDSHostServer2 |
|
89 // ------------------------------------------------------------------------------------------------ |
|
90 // |
|
91 CNSmlDSHostServer2::CNSmlDSHostServer2() |
|
92 { |
|
93 _DBG_FILE( "CNSmlDSHostServer2::CNSmlDSHostServer2(): begin" ); |
|
94 _DBG_FILE( "CNSmlDSHostServer2::CNSmlDSHostServer2(): end" ); |
|
95 } |
|
96 |
|
97 // ------------------------------------------------------------------------------------------------ |
|
98 // CNSmlDSHostServer2::NewSessionL |
|
99 // ------------------------------------------------------------------------------------------------ |
|
100 // |
|
101 CSession2* CNSmlDSHostServer2::NewSessionL( const TVersion& aVersion, const RMessage2& aMessage ) const |
|
102 { |
|
103 return CallNewSessionL( aVersion, aMessage ); |
|
104 } |
|
105 |
|
106 // ------------------------------------------------------------------------------------------------ |
|
107 // |
|
108 // ------------------------------------------------------------------------------------------------ |
|
109 // |
|
110 GLDEF_C TInt E32Main() |
|
111 { |
|
112 return CNSmlDSHostServer2::LaunchServer( NULL ); |
|
113 } |
|
114 |
|
115 // End of File |