Changeset 14086 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Nov 11, 2008 12:06:26 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r14041 r14086 87 87 RTFILE PipeRead; 88 88 #else 89 /* 1 - for Outher network events, and 0 for sending routine notification*/90 HANDLE h NetworkEvent[2];89 /*for send event from guest*/ 90 HANDLE hSendEvent; 91 91 #endif 92 92 /** Send buffer */ … … 119 119 #ifdef VBOX_WITH_SIMPLEFIED_SLIRP_SYNC 120 120 121 int rc; 121 122 /*notify select to wakeup*/ 122 123 memcpy(pThis->cBuffer,pvBuf, cb); 123 124 pThis->sBufferSize = cb; 124 125 # ifndef RT_OS_WINDOWS 125 intrc = RTFileWrite(pThis->PipeWrite, "1", 2, NULL);126 rc = RTFileWrite(pThis->PipeWrite, "1", 2, NULL); 126 127 AssertRC(rc); 127 128 # else 128 WSASetEvent(pThis->hNetworkEvent[0]); 129 rc = WSASetEvent(pThis->hSendEvent); 130 AssertRelease(rc == TRUE); 129 131 # endif 130 132 RTSemEventWait(pThis->semSndMutex, RT_INDEFINITE_WAIT); … … 301 303 # else /* RT_OS_WINDOWS */ 302 304 phEvents = slirp_get_events(pThis->pNATState); 303 phEvents[0] = pThis->h NetworkEvent[0];305 phEvents[0] = pThis->hSendEvent; 304 306 event = WSAWaitForMultipleEvents(nFDs, phEvents, FALSE, 2 /*ms*/, FALSE); 305 307 AssertRelease(event != WSA_WAIT_FAILED); 308 309 if (event == WSA_WAIT_TIMEOUT) { 310 continue; 311 } 306 312 307 313 /* 308 314 * see WSAWaitForMultipleEvents documentation: return value is a minimal index in array 309 315 */ 310 if ((event - WSA_WAIT_EVENT_0) > 1)316 if ((event - WSA_WAIT_EVENT_0) > 0) { 311 317 slirp_select_poll(pThis->pNATState, &ReadFDs, &WriteFDs, &XcptFDs); 318 } 312 319 313 320 if ((event - WSA_WAIT_EVENT_0) == 0) 314 321 { 315 322 /** XXX distinguish between drvNATSend and wakeup only */ 316 slirp_input(pThis->pNATState, (uint8_t *) pThis->cBuffer, pThis->sBufferSize);317 WSAResetEvent(pThis->h NetworkEvent[0]);323 slirp_input(pThis->pNATState, (uint8_t *)&pThis->cBuffer[0], pThis->sBufferSize); 324 WSAResetEvent(pThis->hSendEvent); 318 325 RTSemEventSignal(pThis->semSndMutex); 319 326 } 320 WSAResetEvent(pThis->hNetworkEvent[0]);321 327 # endif /* RT_OS_WINDOWS */ 322 328 } … … 689 695 pThis->PipeWrite = fds[1]; 690 696 # else 691 pThis->hNetworkEvent[0] = WSACreateEvent(); 692 pThis->hNetworkEvent[1] = WSACreateEvent(); 697 pThis->hSendEvent = WSACreateEvent(); 693 698 # endif 694 699
Note:
See TracChangeset
for help on using the changeset viewer.