|
1 // Copyright (c) 1997-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 "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent |
|
19 */ |
|
20 |
|
21 #ifndef __SS_CONNLEGACY_H__ |
|
22 #define __SS_CONNLEGACY_H__ |
|
23 |
|
24 #include <e32def.h> |
|
25 #include <elements/factorynotify.h> |
|
26 #include <es_sock.h> //TNifProgressBuf & co |
|
27 #include <es_prot.h> //TConnStartType &co |
|
28 #include <ss_std.h> |
|
29 #include <comms-infras/ss_nodemessages_legacy.h> |
|
30 #include <comms-infras/ss_nodemessages_legacy_internal.h> |
|
31 #include <comms-infras/ss_legacyinterfaces.h> |
|
32 |
|
33 class TSockOpt; |
|
34 class CActivityTimer; |
|
35 |
|
36 const TInt KNifEMCompatibilityLayerEntireSubConnectionUid = 0; |
|
37 const TInt KNifEMCompatibilityLayerFakeSubConnectionId = 1; |
|
38 |
|
39 namespace ConnStates |
|
40 { |
|
41 class TProcessEnumResponse; |
|
42 class TNoTagOrCancelAllInterfaceWorker; |
|
43 class TCancelAllInterfaceNotificationWorker; |
|
44 } |
|
45 |
|
46 namespace AllInterfaceNotificationActivity |
|
47 { |
|
48 class TEnqueueNotification; |
|
49 class TSendErrorToConnection; |
|
50 } |
|
51 |
|
52 namespace EnumerateConnectionsActivity |
|
53 { |
|
54 class TQueryTierStatus; |
|
55 class TCacheConnectionInfo; |
|
56 class TCompleteClient; |
|
57 } |
|
58 |
|
59 namespace ESock |
|
60 { |
|
61 class ADataMonitoringProvider; |
|
62 class CSubConnection; |
|
63 class CConnManager; |
|
64 class CConnectionProviderBase; |
|
65 class CActivityTimer; |
|
66 class TSelectionPrefs; |
|
67 class TLegacyConnectionEnumRequest; |
|
68 class CLegacySubConnectionActiveResponder; |
|
69 |
|
70 /** |
|
71 Server side class representing an RConnection legacy API |
|
72 @internalComponent |
|
73 */ |
|
74 NONSHARABLE_CLASS(AConnectionLegacy) |
|
75 { |
|
76 friend class CConnection; |
|
77 friend class CSockSession; |
|
78 friend class Factories::TFactoryNotify<AConnectionLegacy>; |
|
79 friend class CActivityTimer; |
|
80 friend class ConnStates::TProcessEnumResponse; |
|
81 friend class TLegacyConnectionEnumRequest; |
|
82 friend class EnumerateConnectionsActivity::TQueryTierStatus; |
|
83 friend class EnumerateConnectionsActivity::TCacheConnectionInfo; |
|
84 friend class EnumerateConnectionsActivity::TCompleteClient; |
|
85 friend class AllInterfaceNotificationActivity::TEnqueueNotification; |
|
86 friend class AllInterfaceNotificationActivity::TSendErrorToConnection; |
|
87 friend class ConnStates::TNoTagOrCancelAllInterfaceWorker; |
|
88 friend class ConnStates::TCancelAllInterfaceNotificationWorker; |
|
89 |
|
90 public: //So that friends of CConnection (transitions) can access it |
|
91 void CompleteAttachL(TSelectionPrefs& aPrefs); |
|
92 void CancelServiceChangeNotification(const Den::RSafeMessage& aMessage); |
|
93 void SubConnectionEvent(const TSubConnectionEvent& aSubConnectionEvent); |
|
94 |
|
95 protected: |
|
96 AConnectionLegacy(CConnection& aConnection) : |
|
97 iConnection(aConnection) |
|
98 { |
|
99 iServiceChangeNotificationPending = EFalse; |
|
100 } |
|
101 |
|
102 ~AConnectionLegacy(); |
|
103 TInt ProcessMessageL(const RMessage2& aMessage); |
|
104 void ReceivedL(const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage); //Only called from CConnection::ReceivedL |
|
105 |
|
106 private: |
|
107 // Underlying implementations of individual RConnection methods |
|
108 void StopL(const RMessage2& aMessage); |
|
109 |
|
110 void GetIntSettingL(const Den::RSafeMessage& aMessage); |
|
111 void GetBoolSettingL(const Den::RSafeMessage& aMessage); |
|
112 void GetDes8SettingL(const Den::RSafeMessage& aMessage); |
|
113 void GetDes16SettingL(const Den::RSafeMessage& aMessage); |
|
114 void GetLongDesSettingL(const Den::RSafeMessage& aMessage); |
|
115 void GetConnectionInfoL(const RMessage2& aMessage); |
|
116 |
|
117 void AllInterfaceNotificationL(const RMessage2& aMessage); |
|
118 void CompleteAllInterfaceNotificationL(TInt aError); |
|
119 void CancelAllInterfaceNotification(); |
|
120 |
|
121 void DataTransferredL(const Den::RSafeMessage& aMessage); |
|
122 void DataSentNotificationRequestL(const Den::RSafeMessage& aMessage); |
|
123 void DataSentNotificationCancel(const Den::RSafeMessage& aMessage); |
|
124 void DataReceivedNotificationRequestL(const Den::RSafeMessage& aMessage); |
|
125 void DataReceivedNotificationCancel(const Den::RSafeMessage& aMessage); |
|
126 void DataMonitoringNotificationRequestL(const Den::RSafeMessage& aMessage, TDataMonitoringDirection aDirection); |
|
127 void DataMonitoringNotificationCancel(const Den::RSafeMessage& aMessage, TDataMonitoringDirection aDirection); |
|
128 |
|
129 void IsSubConnectionActiveRequestL(const Den::RSafeMessage& aMessage); |
|
130 void IsSubConnectionActiveCancel(const Den::RSafeMessage& aMessage); |
|
131 |
|
132 void ExtractEnumInfoL(RBuf8& aBuffer, TUint aCount, TInt aSize, TUint aIndex, TDes8& aPckg); |
|
133 void EnumerateConnectionClientsL(); |
|
134 void GetConnectionClientInfoL(); |
|
135 void RequestDataPlaneEnumerationL(TLegacyConnEnumClients aClientType); |
|
136 void EnumerateConnectionSocketsL(); |
|
137 void CompleteDataPlaneEnumeration(const Messages::TNodeId& aPeer, TInt aCount, HBufC8* aInfo, TInt aError); |
|
138 void GetConnectionSocketInfoL(); |
|
139 void ServiceChangeNotification(TUint32 aId, const TDesC& aType); |
|
140 void FinalCompleteAllBlockedMessages(TInt aResult); |
|
141 void CancelProviderRequests(); |
|
142 |
|
143 |
|
144 #ifndef AVAILABILITY_READY |
|
145 void EnumerateConnectionsL(const RMessage2& aMessage); |
|
146 #endif |
|
147 |
|
148 // SubConnection-oriented RConnection method support |
|
149 void EnumerateSubConnectionsL(const Den::RSafeMessage& aMessage); |
|
150 void GetSubConnectionInfoL(const Den::RSafeMessage& aMessage); |
|
151 |
|
152 static TBool DoesConnectionInfoExist(const TDesC8& aInfoBuf, const TConnectionClientInfo& aInfo); |
|
153 protected: |
|
154 ADataMonitoringProvider* FetchConnDataMonitoringProvider() const; |
|
155 ADataMonitoringProvider* FetchSubConnDataMonitoringProvider() const; |
|
156 |
|
157 //global notifications |
|
158 void InterfaceStateChangeNotification(TDesC8& aInfo); |
|
159 void RequestServiceChangeNotificationL(const Den::RSafeMessage& aMessage); |
|
160 void ControlL(TUint aOptionName, TUint aMessageId); |
|
161 |
|
162 // Underlying implementations of individual RConnection methods relating to subconnections |
|
163 void AllSubConnectionNotificationL(); |
|
164 void CancelAllSubConnectionNotification(); |
|
165 |
|
166 private: |
|
167 RMessage2 iAllSubConnectionNotificationMessage; |
|
168 |
|
169 TInterfaceChangeQueue iInterfaceChangeQueue; // queue of interface notifications received |
|
170 |
|
171 TUint iConnectionInfoCount; |
|
172 TUint iConnectionClientCount; |
|
173 RBuf8 iConnectionClientBuf; |
|
174 TUint iConnectionSocketCount; |
|
175 RBuf8 iConnectionSocketBuf; |
|
176 Den::RSafeMessage iEnumConnMsg; //< During a Data plane enum holds blocked client msg |
|
177 TUint* iDPEnumCount; //< During a Data plane enum points to count recipient |
|
178 RBuf8* iDPEnumBuf; //< During a Data plane enum points to data buf |
|
179 RArray<Messages::TNodeId> iEnumConnSockCandidateSCPRs; //< During a Data plane enum is list of SCPRs for connection |
|
180 |
|
181 RMessage2* iMessage; //current message valid only within ProcessMessageL call |
|
182 CConnection& iConnection; |
|
183 |
|
184 RPointerArray<CSubConnection> iSubConnections; //client classes servicing sub-connection |
|
185 //related functionality requested via legacy RConnection API. sub-connections |
|
186 //objects are owned by AConnectionLegacy instance and don't have RSubConnection |
|
187 //client side. |
|
188 CConnManager* iConnManager; //client class servicing connection manager |
|
189 //related functionality requested via legacy RConnection API. CConnManager |
|
190 //object is owned by AConnectionLegacy instance and does't have RConnManager |
|
191 //client side. |
|
192 // Flags for pending RConnection requests |
|
193 TBool iServiceChangeNotificationPending; |
|
194 |
|
195 // IsSubConnectionActive support |
|
196 ADataMonitoringProvider* iConnActivityDataMonProv; |
|
197 ESock::CActivityTimer* iActivityTimer; |
|
198 TBool iClientsSubConnectionActiveState; |
|
199 TUint iInitialSentDataVolume; |
|
200 TUint iInitialReceivedDataVolume; |
|
201 TUint iRequestedClientActivityTimerPeriod; |
|
202 TBool iOutstandingIsSubConnectionActiveRequest; |
|
203 RMessage2 iOutstandingIsSubConnectionActiveMessage; |
|
204 |
|
205 TBool iDeferredSubConnectionNotificationEnable; |
|
206 TSubConnectionEventQueue iSubConnectionEventQueue; // queue of subconnection events received |
|
207 |
|
208 // EnumerateConnection and GetConnectionInfo use this. |
|
209 RPointerArray<TSourcedConnectionInfo> iConnectionInfoPtrArray; |
|
210 |
|
211 // AllInterfaceNotification support |
|
212 RMessage2 iAllInterfaceNotificationMessage; |
|
213 TInterfaceChangeQueue iNotificationQueue; |
|
214 Messages::TNodeId iAllInterfaceNotificationWorker; |
|
215 |
|
216 protected: |
|
217 static const TAnyFn iInterfaceVTableF[]; |
|
218 }; |
|
219 |
|
220 |
|
221 } //namespace ESock |
|
222 |
|
223 #endif |
|
224 // __SS_CONNLEGACY_H__ |
|
225 |