genericopenlibs/openenvcore/backend/inc/sysif.h
branchRCL_3
changeset 54 4332f0f7be53
parent 53 9d9daa0f4b62
child 56 acd3cd4aaceb
--- a/genericopenlibs/openenvcore/backend/inc/sysif.h	Thu Jul 15 20:34:46 2010 +0300
+++ b/genericopenlibs/openenvcore/backend/inc/sysif.h	Thu Aug 19 11:33:45 2010 +0300
@@ -114,7 +114,7 @@
 */
 	{
 public:
-	void StorePtrs(RHeap* aHeap, RFs* aFs, RSocketServ* aSs, RCommServ* aCs, RFastLock* aSsLock, RFastLock* aCsLock)
+	void StorePtrs(RHeap* aHeap, RFs* aFs, RSocketServ* aSs, RCommServ* aCs, RFastLock* aSsLock, RFastLock* aCsLock,RFastLock* aDefConnLock,RFastLock* aAESelectLock)
 		{
 		iHeap = aHeap;
 		iFs = aFs;
@@ -122,6 +122,8 @@
 		iCs = aCs;
 		iSsLock = aSsLock;
 		iCsLock = aCsLock;
+		iDefConnLock = aDefConnLock;
+		iAESelectLock = aAESelectLock;
 		}
 
 	~TCLSICleanup()
@@ -132,6 +134,8 @@
 		iCs->Close();
 		iCsLock->Close();
 		iHeap->Close();
+		iDefConnLock->Close();
+		iAESelectLock->Close();
 		}
 private:
 	RHeap* iHeap;
@@ -140,6 +144,8 @@
 	RCommServ* iCs;
 	RFastLock* iSsLock;
 	RFastLock* iCsLock;
+	RFastLock* iDefConnLock;
+	RFastLock* iAESelectLock;	
 	};
 
 
@@ -506,7 +512,7 @@
 
 	int aselect(int maxfd, fd_set *readfds, fd_set *writefds,fd_set *exceptfds, struct timeval *tvptr, TRequestStatus* requeststatus,int& anErrno);
 
-	int cancelaselect(TRequestStatus* requeststatus,int& anErrno,int performcleanup = 0);
+	int cancelaselect(TRequestStatus* requeststatus, int& anErrno, TBool perform_cleanup = EFalse);		
 		
 	int eselect(int maxfd, fd_set *readfds, fd_set *writefds,fd_set *exceptfds, struct timeval *tvptr, int arraycount,TRequestStatus* waitarray,int& anErrno);
 	
@@ -552,6 +558,7 @@
 	
 	//Set the default interface for network operations
 	int setdefaultif(const struct ifreq* aIfReq);
+	int unsetdefaultif(TBool allow_bringup = ETrue);
 	
 	IMPORT_C CFileDescBase* GetDesc(int aFid);
 
@@ -669,6 +676,10 @@
 	RConnection iDefConnection;
 	//Protect the iDefConnection from concurrent GetDefaultConnection calls
 	RFastLock   iDefConnLock;
+	//Calling unsetdefaultif(), instead of setdefaultif(NULL) ensures that the torn down
+	//connection is not brought back up again, by subsequent socket/network calls.
+	//This variable enables this facility. It is reset to default (ETrue) by setdefaultif(<pref>)
+	TBool iDefConnResurrect;
 	//Lock for protecting iASelectRequest across threads
 	RFastLock iASelectLock;