|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Symbian Foundation License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // csesuresessionbase.cpp |
|
15 // |
|
16 // |
|
17 |
|
18 #include "csecuresessionbase.h" |
|
19 #include "csecureserverbase.h" |
|
20 #include "lbsmessageenums.h" |
|
21 #include <e32debug.h> |
|
22 /// Lbs |
|
23 #include "lbsdevloggermacros.h" |
|
24 /** |
|
25 constructor, call the CSession2 base class constructor |
|
26 |
|
27 @internalTechnology |
|
28 @released |
|
29 */ |
|
30 CSecureSessionBase::CSecureSessionBase() : CSession2() |
|
31 { |
|
32 LBSLOG(ELogP1,"CSecureSessionBase::CSecureSessionBase"); |
|
33 } |
|
34 |
|
35 /** |
|
36 destructor, decrease the server session count, which will inturn start shutdown timer. |
|
37 |
|
38 @internalTechnology |
|
39 @released |
|
40 */ |
|
41 CSecureSessionBase::~CSecureSessionBase() |
|
42 { |
|
43 LBSLOG(ELogP1,"CSecureSessionBase::~CSecureSessionBase"); |
|
44 const CServer2* baseServer = Server(); |
|
45 reinterpret_cast<CSecureServerBase*>(const_cast<CServer2*>(baseServer))->DecSession(); // reduce the server session count - start shutdown timer etc. |
|
46 } |
|
47 |
|
48 |
|
49 /** |
|
50 function is called by CSession2 to increase the server session count, which will inturn reset shutdown timer. |
|
51 |
|
52 @internalTechnology |
|
53 @released |
|
54 */ |
|
55 void CSecureSessionBase::CreateL() |
|
56 { |
|
57 const CServer2* baseServer = Server(); |
|
58 reinterpret_cast<CSecureServerBase*>(const_cast<CServer2*>(baseServer))->IncSession(); // increase the server session count - stop shutdown timer etc. |
|
59 } |
|
60 |
|
61 /** |
|
62 Disconnect the session. |
|
63 |
|
64 @param aMessage A reference to RMessage2 object |
|
65 @internalTechnology |
|
66 @released |
|
67 */ |
|
68 void CSecureSessionBase::Disconnect(const RMessage2& aMessage) |
|
69 { |
|
70 LBSLOG(ELogP1,"CSecureSessionBase::Disconnect"); |
|
71 CSession2::Disconnect(aMessage); |
|
72 // used for a breakpoint |
|
73 } |
|
74 |
|
75 /** |
|
76 Session message dispatch function |
|
77 |
|
78 @param aMessage A reference to RMessage2 object |
|
79 @internalTechnology |
|
80 @released |
|
81 */ |
|
82 void CSecureSessionBase::ServiceL(const RMessage2& aMessage) |
|
83 { |
|
84 DispatchL(aMessage); // if this leaves it hits CSession2::ServiceError (or the derived version of it) |
|
85 } |
|
86 |
|
87 /** |
|
88 Session error message dispatch function, this is called when error happens, it dispatches the error locally and |
|
89 then pass the error message to CSession2 |
|
90 |
|
91 @param aMessage A reference to RMessage2 object |
|
92 @param aError Error code |
|
93 @internalTechnology |
|
94 @released |
|
95 */ |
|
96 void CSecureSessionBase::ServiceError(const RMessage2& aMessage, TInt aError) |
|
97 { |
|
98 DispatchError(aMessage, aError); // provide the opportunity to do something locally |
|
99 // now take the base class actions |
|
100 CSession2::ServiceError(aMessage, aError); // will complete aMessage with aError if not already completed. |
|
101 } |
|
102 |
|
103 /** |
|
104 Nothing here. a place for extra subsession construction functionalities |
|
105 |
|
106 @internalTechnology |
|
107 @released |
|
108 */ |
|
109 void CSecureSessionBase::ConstructSubSessionL() |
|
110 { |
|
111 // does nothing in the default base class |
|
112 } |
|
113 |
|
114 /** |
|
115 Nothing here. a place for extra subsession destruction functionalities |
|
116 |
|
117 @internalTechnology |
|
118 @released |
|
119 */ |
|
120 void CSecureSessionBase::DestroySubSession() |
|
121 { |
|
122 // does nothing in the default base class |
|
123 } |