datacommsserver/esockserver/inc/es_sap.h
branchRCL_3
changeset 9 77effd21b2c9
parent 0 dfb7c4ff071f
equal deleted inserted replaced
5:68ef71f0cd72 9:77effd21b2c9
    48 
    48 
    49 @internalTechnology
    49 @internalTechnology
    50 @released Since 9.0 */
    50 @released Since 9.0 */
    51 	{
    51 	{
    52 	friend class ProtocolManager;
    52 	friend class ProtocolManager;
       
    53 
    53 public:
    54 public:
    54 
    55 
    55 	IMPORT_C virtual ~CNetworkFlow();
    56 	IMPORT_C virtual ~CNetworkFlow();
    56 
    57 
    57 protected:
    58 protected:
    76         return  iSessionControlNotify || iSessionDataNotify;
    77         return  iSessionControlNotify || iSessionDataNotify;
    77         }
    78         }
    78 
    79 
    79 	void ProcessDCIdleState();
    80 	void ProcessDCIdleState();
    80 
    81 
    81 #ifdef SYMBIAN_NETWORKING_UPS
    82 	
    82 	virtual TBool ActivityRunning() = 0;
       
    83 #else
       
    84     inline TBool NoBearerGuard()
       
    85     	{ return iNoBearerRunning; }
       
    86     inline void SetNoBearerGuard()
       
    87     	{ iNoBearerRunning = ETrue; }
       
    88     inline void ClearNoBearerGuard()
       
    89     	{ iNoBearerRunning = EFalse; }
       
    90 #endif
       
    91 
       
    92 protected:
    83 protected:
    93 	IMPORT_C CNetworkFlow(CSubConnectionFlowFactoryBase& aFactory, const Messages::TNodeId& aSubConn, CProtocolIntfBase* aProtocolIntf);
    84 	IMPORT_C CNetworkFlow(CSubConnectionFlowFactoryBase& aFactory, const Messages::TNodeId& aSubConn, CProtocolIntfBase* aProtocolIntf);
    94 	void UpdateDestinationAddress(const TSockAddr& aDest);
    85 	void UpdateDestinationAddress(const TSockAddr& aDest);
       
    86 
       
    87     #define SAP_FLAG_FUNCTIONS(name, flag) \
       
    88 		inline TBool name() { return iStateFlags & flag; } \
       
    89 		inline void Set##name() { iStateFlags |= flag; }	\
       
    90 		inline void Clear##name() { iStateFlags &= ~flag; }
       
    91 
       
    92 #ifdef SYMBIAN_NETWORKING_UPS
       
    93 	virtual TBool ActivityRunning() = 0;
       
    94 #endif
       
    95 
    95 
    96 
    96 protected:
    97 protected:
    97 	TSockAddr iLocalAddress;
    98 	TSockAddr iLocalAddress;
    98 	TSockAddr iRemoteAddress;
    99 	TSockAddr iRemoteAddress;
    99 
   100 
   102 	MSessionDataNotify* iSessionDataNotify;
   103 	MSessionDataNotify* iSessionDataNotify;
   103 	//lower flow
   104 	//lower flow
   104 	MFlowBinderControl* iLowerFlow;
   105 	MFlowBinderControl* iLowerFlow;
   105 	MLowerControl* iLowerControl; //just to keep the lower flow up
   106 	MLowerControl* iLowerControl; //just to keep the lower flow up
   106 
   107 
   107 	enum TDCIdleState
   108 	enum TStateFlag
   108 		{
   109 		{
   109 		EClientsPresent = 0, // presumption is we're always created for a client (ie HR or socket)
   110 		ELocalAddressSet = 0x00000001,
   110 		EIdle = 1,
   111 		ERemoteAddressSet = 0x00000002,
   111 		EIdleSent = 2
   112 		ENoBearerRunning = 0x00000004,
       
   113 		EStarted = 0x00000008,
       
   114 		EIdle = 0x00000080,
       
   115 		EIdleSent = 0x00000100
   112 		};
   116 		};
   113 	TBool iLocalAddressSet:1;
   117 	SAP_FLAG_FUNCTIONS(LocalAddressSet, ELocalAddressSet)
   114 	TBool iRemoteAddressSet:1;
   118 	SAP_FLAG_FUNCTIONS(RemoteAddressSet, ERemoteAddressSet)
   115 	TBool iConnectionInfoSet:1;
   119 	SAP_FLAG_FUNCTIONS(NoBearerGuard, ENoBearerRunning)
   116 	TBool iJoinOutstanding:1;
   120 	SAP_FLAG_FUNCTIONS(Started, EStarted)
   117 	TBool iLeaveOutstanding:1;	
   121 	SAP_FLAG_FUNCTIONS(Idle, EIdle)
   118 #ifndef SYMBIAN_NETWORKING_UPS
   122 	SAP_FLAG_FUNCTIONS(IdleSent, EIdleSent)
   119 	TBool iNoBearerRunning:1;			// NoBearer msg has been issued to SCPR
   123 		
   120 #endif
   124 	TUint iStateFlags;
   121 	TBool iIsStarted:1;	
       
   122 	TDCIdleState iDCIdle:2;			
       
   123 	};
   125 	};
   124 
   126 
   125 } //namespace ESock
   127 } //namespace ESock
   126 
   128 
   127 #endif	// __ES_SAP_H__
   129 #endif	// __ES_SAP_H__