63 { |
63 { |
64 friend class ASocket; |
64 friend class ASocket; |
65 #ifdef SYMBIAN_NETWORKING_UPS |
65 #ifdef SYMBIAN_NETWORKING_UPS |
66 friend class CHostResolver; // to allow CHostResolver to call SecurityCheck() |
66 friend class CHostResolver; // to allow CHostResolver to call SecurityCheck() |
67 #endif |
67 #endif |
|
68 |
68 public: |
69 public: |
69 typedef CTransportFlowShimFactory FactoryType; //for factoryobject_cast to work |
70 typedef CTransportFlowShimFactory FactoryType; //for factoryobject_cast to work |
70 |
71 |
71 static CTransportFlowShim* NewL(CSubConnectionFlowFactoryBase& aFactory, const Messages::TNodeId& aSubConn, CProtocolIntfBase* aProtocolIntf); |
72 static CTransportFlowShim* NewL(CSubConnectionFlowFactoryBase& aFactory, const Messages::TNodeId& aSubConn, CProtocolIntfBase* aProtocolIntf); |
72 void SetSSP(CServProviderBase& aSSP); |
73 void SetSSP(CServProviderBase& aSSP); |
163 |
164 |
164 // Utility functions |
165 // Utility functions |
165 inline TBool IsHostResolver() const; |
166 inline TBool IsHostResolver() const; |
166 inline TBool IsStopped(); |
167 inline TBool IsStopped(); |
167 inline void SetIfInfo(const TSoIfConnectionInfo& aInfo); |
168 inline void SetIfInfo(const TSoIfConnectionInfo& aInfo); |
168 inline void ClearUseBearerErrors(); |
169 |
169 inline void ClearDataClientRoutedGuard(); |
|
170 |
|
171 void PostNoBearer(); |
170 void PostNoBearer(); |
172 void PostDataClientRouted(); |
171 void PostDataClientRouted(); |
173 // From MSocketNotify |
172 // From MSocketNotify |
174 virtual void Error(TInt anError,TUint anOperationMask=MSocketNotify::EErrorAllOperations); |
173 virtual void Error(TInt anError,TUint anOperationMask=MSocketNotify::EErrorAllOperations); |
175 #endif |
174 #endif |
201 void InitDestroy(); |
200 void InitDestroy(); |
202 #ifndef SYMBIAN_NETWORKING_UPS |
201 #ifndef SYMBIAN_NETWORKING_UPS |
203 // Needs to be protected rather than private for UPS support |
202 // Needs to be protected rather than private for UPS support |
204 void PostNoBearer(); |
203 void PostNoBearer(); |
205 void PostDataClientRouted(); |
204 void PostDataClientRouted(); |
206 inline void ClearDataClientRoutedGuard(); |
|
207 #endif |
205 #endif |
208 void CompleteStart(TInt aError); |
206 void CompleteStart(TInt aError); |
209 |
207 |
210 #ifdef SYMBIAN_NETWORKING_UPS |
|
211 // Not entirely UPS specific - cleanup of CNetworkFlow/CTransportFlowShim functionality split |
|
212 inline TBool NoBearerGuard() const; |
|
213 inline void SetNoBearerGuard(); |
|
214 inline void ClearNoBearerGuard(); |
|
215 #endif |
|
216 void NoBearerCompletion(); |
208 void NoBearerCompletion(); |
217 inline void SetFlowParams(const TFlowParams& aFlowParams); |
209 inline void SetFlowParams(const TFlowParams& aFlowParams); |
218 inline TBool FlowParamsInitialised() const; |
210 |
|
211 protected: |
|
212 // Flags to set on iStateFlags inherited from CNetworkFlow |
|
213 enum TStateFlag |
|
214 { |
|
215 EDetaching = 0x0001000, |
|
216 EDataClientRoutedGuard = 0x00020000, |
|
217 EStopped = 0x00040000, |
|
218 EShuttingDown = 0x00080000, |
|
219 EFlowParamsInitialised = 0x00100000, |
|
220 EBearerExpected = 0x00200000, |
|
221 EDeleteUponBearerReception = 0x00400000, |
|
222 EUseBearerErrors = 0x00800000 |
|
223 }; |
|
224 SAP_FLAG_FUNCTIONS(Detaching, EDetaching) |
|
225 SAP_FLAG_FUNCTIONS(DataClientRoutedGuard, EDataClientRoutedGuard) |
|
226 SAP_FLAG_FUNCTIONS(Stopped, EStopped) |
|
227 SAP_FLAG_FUNCTIONS(ShuttingDown, EShuttingDown) |
|
228 SAP_FLAG_FUNCTIONS(FlowParamsInitialised, EFlowParamsInitialised) |
|
229 SAP_FLAG_FUNCTIONS(BearerExpected, EBearerExpected) |
|
230 SAP_FLAG_FUNCTIONS(DeleteUponBearerReception, EDeleteUponBearerReception) |
|
231 SAP_FLAG_FUNCTIONS(UseBearerErrors, EUseBearerErrors) |
219 |
232 |
220 private: |
233 private: |
221 CServProviderBase* iProvider; |
234 CServProviderBase* iProvider; |
222 //CHostResolver specific workaround for now |
235 //CHostResolver specific workaround for now |
223 MUpperControl* iHostResolverNotify; //since CHostResolver specific |
236 MUpperControl* iHostResolverNotify; //since CHostResolver specific |
225 // TODO |
238 // TODO |
226 // MSocketControlledNotify* iSocket; |
239 // MSocketControlledNotify* iSocket; |
227 Messages::RRequestOriginator iStartRequest; |
240 Messages::RRequestOriginator iStartRequest; |
228 |
241 |
229 TSoIfConnectionInfo iIfInfo; |
242 TSoIfConnectionInfo iIfInfo; |
230 TUint iDetaching:1; |
243 |
231 TUint iUseBearerErrors:1; // error the socket on Error() upcalls from bearer rather than StopFlow() calls from SCPR |
244 |
232 TUint iDataClientRoutedGuard:1; // DataClientRouted msg has been issued to SCPR |
|
233 TUint iIsStopped:1; // DataClientStop has been received. |
|
234 #ifdef SYMBIAN_NETWORKING_UPS |
|
235 TBool iNoBearerRunning:1; // NoBearer message has been issued to SCPR |
|
236 TBool iShuttingDown:1; |
|
237 #endif |
|
238 TBool iFlowParamsInitialised:1; // whether iFlowParams has been initialised or not |
|
239 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
245 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
240 const CSAPSetOpt *iProtocolOptions; |
246 const CSAPSetOpt *iProtocolOptions; |
241 #endif //SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
247 #endif //SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
242 |
248 |
243 // Reference to the protocol as managed by the ProtocolManager |
249 // Reference to the protocol as managed by the ProtocolManager |
244 CProtocolRef* iProtocolReference; |
250 CProtocolRef* iProtocolReference; |
245 TFlowParams iFlowParams; |
251 TFlowParams iFlowParams; |
246 TBool iBearerExpected; |
|
247 TBool iDeleteUponBearerReception; |
|
248 }; |
252 }; |
249 |
253 |
250 inline CServProviderBase* CTransportFlowShim::Provider() |
254 inline CServProviderBase* CTransportFlowShim::Provider() |
251 { |
255 { |
252 return iProvider; |
256 return iProvider; |
253 } |
257 } |
254 |
258 |
255 inline void CTransportFlowShim::SetFlowParams(const TFlowParams& aFlowParams) |
259 inline void CTransportFlowShim::SetFlowParams(const TFlowParams& aFlowParams) |
256 { |
260 { |
257 iFlowParams = aFlowParams; |
261 iFlowParams = aFlowParams; |
258 iFlowParamsInitialised = ETrue; |
262 SetFlowParamsInitialised(); |
259 } |
263 } |
260 |
264 |
261 inline TBool CTransportFlowShim::FlowParamsInitialised() const |
|
262 { |
|
263 return iFlowParamsInitialised; |
|
264 } |
|
265 |
|
266 #ifdef SYMBIAN_NETWORKING_UPS |
265 #ifdef SYMBIAN_NETWORKING_UPS |
267 |
266 |
268 // |
267 // |
269 // CTransportFlowShim inline methods |
268 // CTransportFlowShim inline methods |
270 // |
269 // |
271 |
|
272 inline TBool CTransportFlowShim::NoBearerGuard() const |
|
273 { return iNoBearerRunning; } |
|
274 |
|
275 inline void CTransportFlowShim::SetNoBearerGuard() |
|
276 { iNoBearerRunning = ETrue; } |
|
277 |
|
278 inline void CTransportFlowShim::ClearNoBearerGuard() |
|
279 { iNoBearerRunning = EFalse; } |
|
280 |
|
281 inline void CTransportFlowShim::ClearUseBearerErrors() |
|
282 { iUseBearerErrors = EFalse; } |
|
283 |
|
284 inline TBool CTransportFlowShim::IsStopped() |
|
285 { return iIsStopped; } |
|
286 |
|
287 inline TBool CTransportFlowShim::IsHostResolver() const |
270 inline TBool CTransportFlowShim::IsHostResolver() const |
288 { return iHostResolverNotify != NULL; } |
271 { return iHostResolverNotify != NULL; } |
289 |
272 |
290 inline void CTransportFlowShim::SetIfInfo(const TSoIfConnectionInfo& aInfo) |
273 inline void CTransportFlowShim::SetIfInfo(const TSoIfConnectionInfo& aInfo) |
291 { iIfInfo = aInfo; } |
274 { iIfInfo = aInfo; } |