Changeset 73618 in vbox for trunk/src/VBox
- Timestamp:
- Aug 10, 2018 2:16:56 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Serial/DrvTCP.cpp
r69419 r73618 133 133 else 134 134 { 135 /* Always include error event. */ 136 fEvts |= RTPOLL_EVT_ERROR; 137 rc = RTPollSetEventsChange(pThis->hPollSet, DRVTCP_POLLSET_ID_SOCKET, fEvts); 138 AssertRC(rc); 139 } 140 } 141 142 if (RT_SUCCESS(rc)) 143 { 144 while (RT_SUCCESS(rc)) 145 { 146 uint32_t fEvtsRecv = 0; 147 uint32_t idHnd = 0; 148 135 149 /* 136 * Just return if the send buffer wasn't full till now and 137 * the caller wants to check whether writing is possible with 138 * the event set. 150 * Just check for data available to be read if the send buffer wasn't full till now and 151 * the caller wants to check whether writing is possible with the event set. 139 152 * 140 153 * On Windows the write event is only posted after a send operation returned … … 143 156 */ 144 157 if ( (fEvts & RTPOLL_EVT_WRITE) 145 && !pThis->fXmitBufFull) 146 { 147 *pfEvts = RTPOLL_EVT_WRITE; 148 return VINF_SUCCESS; 149 } 150 151 /* Always include error event. */ 152 fEvts |= RTPOLL_EVT_ERROR; 153 rc = RTPollSetEventsChange(pThis->hPollSet, DRVTCP_POLLSET_ID_SOCKET, fEvts); 154 AssertRC(rc); 155 } 156 } 157 158 if (RT_SUCCESS(rc)) 159 { 160 while (RT_SUCCESS(rc)) 161 { 162 uint32_t fEvtsRecv = 0; 163 uint32_t idHnd = 0; 158 && !pThis->fXmitBufFull 159 && pThis->fTcpSockInPollSet) 160 cMillies = 0; 164 161 165 162 rc = RTPoll(pThis->hPollSet, cMillies, &fEvtsRecv, &idHnd); … … 209 206 if (fEvtsRecv & RTPOLL_EVT_WRITE) 210 207 pThis->fXmitBufFull = false; 208 else if (!pThis->fXmitBufFull) 209 fEvtsRecv |= RTPOLL_EVT_WRITE; 211 210 *pfEvts = fEvtsRecv; 212 211 break; 213 212 } 214 213 } 214 } 215 else if ( rc == VERR_TIMEOUT 216 && !pThis->fXmitBufFull) 217 { 218 *pfEvts = RTPOLL_EVT_WRITE; 219 rc = VINF_SUCCESS; 220 break; 215 221 } 216 222 }
Note:
See TracChangeset
for help on using the changeset viewer.