Changeset 27510 in vbox for trunk/src/VBox
- Timestamp:
- Mar 19, 2010 1:37:08 AM (15 years ago)
- Location:
- trunk/src/VBox/Runtime/r3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/socket.cpp
r27509 r27510 156 156 #endif 157 157 } RTSOCKADDRUNION; 158 159 160 /*******************************************************************************161 * Internal Functions *162 *******************************************************************************/163 158 164 159 … … 909 904 910 905 /** 906 * Undos the harm done by WSAEventSelect. 907 * 908 * @returns IPRT status code. 909 * @param pThis The socket handle. 910 */ 911 static int rtSocketPollClearEventAndMakeBlocking(RTSOCKETINT *pThis) 912 { 913 int rc = VINF_SUCCESS; 914 if (pThis->fSubscribedEvts) 915 { 916 if (WSAEventSelect(pThis->hNative, WSA_INVALID_EVENT, 0) == 0) 917 { 918 pThis->fSubscribedEvts = 0; 919 920 u_long fNonBlocking = 0; 921 int rc2 = ioctlsocket(pThis->hNative, FIONBIO, &fNonBlocking); 922 if (rc2 != 0) 923 { 924 rc = rtSocketError(); 925 AssertMsgFailed(("%Rrc; rc2=%d\n", rc, rc2)); 926 } 927 } 928 else 929 { 930 rc = rtSocketError(); 931 AssertMsgFailed(("%Rrc\n", rc)); 932 } 933 } 934 return rc; 935 } 936 937 938 /** 911 939 * Updates the mask of events we're subscribing to. 912 940 * … … 927 955 { 928 956 pThis->fSubscribedEvts = fEvents; 929 930 u_long fNonBlocking = 0;931 if (ioctlsocket(pThis->hNative, FIONBIO, &fNonBlocking))932 AssertMsgFailed(("%Rrc\n", rtSocketError()));933 934 957 return VINF_SUCCESS; 935 958 } … … 1052 1075 { 1053 1076 if (pThis->cUsers == 1) 1077 { 1078 rtSocketPollClearEventAndMakeBlocking(pThis); 1054 1079 pThis->hPollSet = NIL_RTPOLLSET; 1080 } 1055 1081 ASMAtomicDecU32(&pThis->cUsers); 1056 1082 } … … 1087 1113 pThis->fPollEvts = 0; 1088 1114 1089 /* unlock the socket. */1115 /* Make the socket blocking again and unlock the handle. */ 1090 1116 if (pThis->cUsers == 1) 1117 { 1118 rtSocketPollClearEventAndMakeBlocking(pThis); 1091 1119 pThis->hPollSet = NIL_RTPOLLSET; 1120 } 1092 1121 ASMAtomicDecU32(&pThis->cUsers); 1093 1122 return fRetEvents; -
trunk/src/VBox/Runtime/r3/win/poll-win.cpp
r27509 r27510 197 197 if ( dwRc >= WAIT_OBJECT_0 198 198 && dwRc < WAIT_OBJECT_0 + cHandles) 199 rc = V INF_SUCCESS;199 rc = VERR_INTERRUPTED; 200 200 else if (dwRc == WAIT_TIMEOUT) 201 201 rc = VERR_TIMEOUT;
Note:
See TracChangeset
for help on using the changeset viewer.