|
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: Main class for server side sessions |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __CSuplIPCSession_H__ |
|
21 #define __CSuplIPCSession_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <lbspositioninfo.h> |
|
26 #include <epos_suplterminal.h> |
|
27 |
|
28 #include "epos_mconnecttimerobserver.h" |
|
29 |
|
30 const TSecureId KSuplWapSecureId = 0x1020d684; |
|
31 // FORWARD DECLARATIONS |
|
32 class CSuplServer; |
|
33 class CSuplSubsessionRegistry; |
|
34 class CSuplConnectTimer; |
|
35 |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * The SUPL IPC session class. |
|
41 * |
|
42 * This inherits from CSession2 |
|
43 */ |
|
44 class CSuplIPCSession : public CSession2,public MConnectTimerObserver |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * C++ destructor |
|
50 */ |
|
51 ~CSuplIPCSession(); |
|
52 |
|
53 /** |
|
54 * Two-phased constructor. |
|
55 * |
|
56 * @param aServer Pointer to the server Active Object |
|
57 * @return Pointer to a new instance of CSuplIPCSession |
|
58 */ |
|
59 static CSuplIPCSession* NewL( |
|
60 /* IN */ CSuplServer& aServer, |
|
61 /* IN */ CSuplSessionManager& aSessnMgr, |
|
62 /* IN */ TInt aSessionCount |
|
63 ); |
|
64 |
|
65 public: // New functions |
|
66 |
|
67 /** |
|
68 * Called when the server class is shutting down. |
|
69 */ |
|
70 void NotifyServerShutdown(); |
|
71 |
|
72 // Functions from base classes |
|
73 |
|
74 /** |
|
75 * From CSession2 |
|
76 * |
|
77 * This function services all requests from clients. |
|
78 * |
|
79 * @param aMessage the message that should be serviced |
|
80 */ |
|
81 void ServiceL( |
|
82 /* IN */ const RMessage2& aMessage |
|
83 ); |
|
84 |
|
85 /* |
|
86 Function: CLoseSubsessionL() |
|
87 Used for closing a particular subsession. |
|
88 Param: aMessage |
|
89 Return: None |
|
90 */ |
|
91 void CloseSubsessionL(const RMessage2& aMessage); |
|
92 void ForwardMessageL(const RMessage2& aMessage); |
|
93 void CompleteConnect(TInt aHandle); |
|
94 void CompleteConnectTimerL(); |
|
95 void ProtocolHUnloaded(); |
|
96 |
|
97 private: |
|
98 |
|
99 CSuplIPCSession( |
|
100 CSuplServer& aServer, |
|
101 CSuplSessionManager& aSessnMgr |
|
102 ); |
|
103 |
|
104 void ConstructL(TInt aIpcSessionId); |
|
105 |
|
106 // By default, prohibit copy constructor |
|
107 CSuplIPCSession( const CSuplIPCSession& ); |
|
108 // Prohibit assigment operator |
|
109 CSuplIPCSession& operator= ( const CSuplIPCSession& ); |
|
110 |
|
111 void ForwardToSubSessionL(const RMessage2& aMessage); |
|
112 |
|
113 void CreateSubSessionL( |
|
114 const RMessage2& aMessage, |
|
115 CSUPLProtocolManagerBase::TSuplReqType aReqType, |
|
116 RSuplTerminalSubSession::TSuplServiceType aSuplService |
|
117 ); |
|
118 |
|
119 |
|
120 void RequestComplete( |
|
121 const RMessage2& aMessage, |
|
122 TInt aCompleteCode |
|
123 ); |
|
124 |
|
125 private: // Data |
|
126 enum TConnectRequestType |
|
127 { |
|
128 ETerminalConnectOpen, |
|
129 ENetworkConnectForwardMessage |
|
130 }; |
|
131 CSuplServer& iSuplServer; |
|
132 CSuplSubsessionRegistry* iSubSessionRegistry; |
|
133 CSuplSessionManager& iSessionManager; |
|
134 TBool iDecrementSessions; |
|
135 TBool iServerShutdown; |
|
136 TInt iMessageId; |
|
137 CSuplConnectTimer* iConnectTimer; |
|
138 TTimeIntervalMicroSeconds32 iConnectDelay; |
|
139 TConnectRequestType iReqType; |
|
140 RMessage2 iMessage; |
|
141 TInt iConnectCount; |
|
142 TInt iIpcSessionId; |
|
143 RSuplTerminalSubSession::TSuplServiceType iSuplService; |
|
144 }; |
|
145 |
|
146 #endif // __CSuplIPCSession_H__ |
|
147 |
|
148 // End of File |