112 /* |
112 /* |
113 @internalComponent |
113 @internalComponent |
114 */ |
114 */ |
115 { |
115 { |
116 public: |
116 public: |
117 void StorePtrs(RHeap* aHeap, RFs* aFs, RSocketServ* aSs, RCommServ* aCs, RFastLock* aSsLock, RFastLock* aCsLock) |
117 void StorePtrs(RHeap* aHeap, RFs* aFs, RSocketServ* aSs, RCommServ* aCs, RFastLock* aSsLock, RFastLock* aCsLock,RFastLock* aDefConnLock,RFastLock* aAESelectLock) |
118 { |
118 { |
119 iHeap = aHeap; |
119 iHeap = aHeap; |
120 iFs = aFs; |
120 iFs = aFs; |
121 iSs = aSs; |
121 iSs = aSs; |
122 iCs = aCs; |
122 iCs = aCs; |
123 iSsLock = aSsLock; |
123 iSsLock = aSsLock; |
124 iCsLock = aCsLock; |
124 iCsLock = aCsLock; |
|
125 iDefConnLock = aDefConnLock; |
|
126 iAESelectLock = aAESelectLock; |
125 } |
127 } |
126 |
128 |
127 ~TCLSICleanup() |
129 ~TCLSICleanup() |
128 { |
130 { |
129 iFs->Close(); |
131 iFs->Close(); |
130 iSs->Close(); |
132 iSs->Close(); |
131 iSsLock->Close(); |
133 iSsLock->Close(); |
132 iCs->Close(); |
134 iCs->Close(); |
133 iCsLock->Close(); |
135 iCsLock->Close(); |
134 iHeap->Close(); |
136 iHeap->Close(); |
|
137 iDefConnLock->Close(); |
|
138 iAESelectLock->Close(); |
135 } |
139 } |
136 private: |
140 private: |
137 RHeap* iHeap; |
141 RHeap* iHeap; |
138 RFs* iFs; |
142 RFs* iFs; |
139 RSocketServ* iSs; |
143 RSocketServ* iSs; |
140 RCommServ* iCs; |
144 RCommServ* iCs; |
141 RFastLock* iSsLock; |
145 RFastLock* iSsLock; |
142 RFastLock* iCsLock; |
146 RFastLock* iCsLock; |
|
147 RFastLock* iDefConnLock; |
|
148 RFastLock* iAESelectLock; |
143 }; |
149 }; |
144 |
150 |
145 |
151 |
146 class TFileTableCleanup |
152 class TFileTableCleanup |
147 { |
153 { |
504 |
510 |
505 int select (int maxfd, fd_set* readfds,fd_set* writefds,fd_set* exceptfds, struct timeval* tvptr, int& anErrno); |
511 int select (int maxfd, fd_set* readfds,fd_set* writefds,fd_set* exceptfds, struct timeval* tvptr, int& anErrno); |
506 |
512 |
507 int aselect(int maxfd, fd_set *readfds, fd_set *writefds,fd_set *exceptfds, struct timeval *tvptr, TRequestStatus* requeststatus,int& anErrno); |
513 int aselect(int maxfd, fd_set *readfds, fd_set *writefds,fd_set *exceptfds, struct timeval *tvptr, TRequestStatus* requeststatus,int& anErrno); |
508 |
514 |
509 int cancelaselect(TRequestStatus* requeststatus,int& anErrno,int performcleanup = 0); |
515 int cancelaselect(TRequestStatus* requeststatus, int& anErrno, TBool perform_cleanup = EFalse); |
510 |
516 |
511 int eselect(int maxfd, fd_set *readfds, fd_set *writefds,fd_set *exceptfds, struct timeval *tvptr, int arraycount,TRequestStatus* waitarray,int& anErrno); |
517 int eselect(int maxfd, fd_set *readfds, fd_set *writefds,fd_set *exceptfds, struct timeval *tvptr, int arraycount,TRequestStatus* waitarray,int& anErrno); |
512 |
518 |
513 static TInt handleaselect(TAny* aPtr); |
519 static TInt handleaselect(TAny* aPtr); |
514 |
520 |
550 |
556 |
551 int SetEcho(int aFd, TUint8 aEcho, int& aErrno); |
557 int SetEcho(int aFd, TUint8 aEcho, int& aErrno); |
552 |
558 |
553 //Set the default interface for network operations |
559 //Set the default interface for network operations |
554 int setdefaultif(const struct ifreq* aIfReq); |
560 int setdefaultif(const struct ifreq* aIfReq); |
|
561 int unsetdefaultif(TBool allow_bringup = ETrue); |
555 |
562 |
556 IMPORT_C CFileDescBase* GetDesc(int aFid); |
563 IMPORT_C CFileDescBase* GetDesc(int aFid); |
557 |
564 |
558 // functions returning session to File Server |
565 // functions returning session to File Server |
559 IMPORT_C RFs& FileSession(); |
566 IMPORT_C RFs& FileSession(); |
667 RFastLock iTLDListLock; |
674 RFastLock iTLDListLock; |
668 //The default connection to be used for all network apis. |
675 //The default connection to be used for all network apis. |
669 RConnection iDefConnection; |
676 RConnection iDefConnection; |
670 //Protect the iDefConnection from concurrent GetDefaultConnection calls |
677 //Protect the iDefConnection from concurrent GetDefaultConnection calls |
671 RFastLock iDefConnLock; |
678 RFastLock iDefConnLock; |
|
679 //Calling unsetdefaultif(), instead of setdefaultif(NULL) ensures that the torn down |
|
680 //connection is not brought back up again, by subsequent socket/network calls. |
|
681 //This variable enables this facility. It is reset to default (ETrue) by setdefaultif(<pref>) |
|
682 TBool iDefConnResurrect; |
672 //Lock for protecting iASelectRequest across threads |
683 //Lock for protecting iASelectRequest across threads |
673 RFastLock iASelectLock; |
684 RFastLock iASelectLock; |
674 |
685 |
675 // iASelectRequest holds the TASelectRequest objects of the aselect requests |
686 // iASelectRequest holds the TASelectRequest objects of the aselect requests |
676 RArray<TASelectRequest> iASelectRequest; |
687 RArray<TASelectRequest> iASelectRequest; |