Changeset 15266 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Dec 10, 2008 5:21:43 PM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r14391 r15266 372 372 { 373 373 /* only check for slow/fast timers */ 374 slirp_select_poll(pThis->pNATState, NULL, NULL, NULL);374 slirp_select_poll(pThis->pNATState, /* fTimeout=*/true, /*fIcmp=*/false); 375 375 continue; 376 376 } 377 377 378 378 /* poll the sockets in any case */ 379 slirp_select_poll(pThis->pNATState, &ReadFDs, &WriteFDs, &XcptFDs);379 slirp_select_poll(pThis->pNATState, /* fTimeout=*/false, /* fIcmp=*/(event == WSA_WAIT_EVENT_0)); 380 380 /* process _all_ outstanding requests but don't wait */ 381 381 RTReqProcess(pThis->pReqQueue, 0); -
trunk/src/VBox/Devices/Network/slirp/libslirp.h
r15086 r15266 36 36 fd_set *readfds, fd_set *writefds, fd_set *xfds); 37 37 38 #if defined(RT_OS_WINDOWS) && defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) 39 void slirp_select_poll(PNATState pData, int fTimeout, int fIcmp); 40 #else 38 41 void slirp_select_poll(PNATState pData, fd_set *readfds, fd_set *writefds, fd_set *xfds); 42 #endif 39 43 40 44 void slirp_input(PNATState pData, const uint8_t *pkt, int pkt_len); … … 51 55 52 56 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 57 58 # ifdef VBOX_WITH_SLIRP_ICMP 59 60 /* 61 * ICMP handle state change 62 */ 63 #define VBOX_ICMP_EVENT_INDEX 0 64 53 65 /** 54 66 * This event is for … … 57 69 * - slirp_link_down 58 70 * - wakeup 59 *60 * The event index should be smaller than VBOX_SOCKET_EVENT_INDEX to ensure61 * that we can detect if that event was set (WSAWaitForMultipleEvents()62 * returns the index of the first active event).63 71 */ 64 # define VBOX_WAKEUP_EVENT_INDEX 072 # define VBOX_WAKEUP_EVENT_INDEX 1 65 73 66 74 /* 67 75 * UDP/TCP socket state change (socket ready to receive, to send, ...) 68 76 */ 69 #define VBOX_SOCKET_EVENT_INDEX 1 70 71 #ifdef VBOX_WITH_SLIRP_ICMP 72 /* 73 * ICMP handle state change 74 */ 75 #define VBOX_ICMP_EVENT_INDEX 2 77 # define VBOX_SOCKET_EVENT_INDEX 2 76 78 77 79 /* 78 80 * The number of events for WSAWaitForMultipleEvents(). 79 81 */ 80 #define VBOX_EVENT_COUNT 3 81 #else 82 /* 83 * The number of events for WSAWaitForMultipleEvents(). 84 */ 85 #define VBOX_EVENT_COUNT 2 82 # define VBOX_EVENT_COUNT 3 86 83 87 #endif 84 # else 85 86 # define VBOX_WAKEUP_EVENT_INDEX 0 87 # define VBOX_SOCKET_EVENT_INDEX 1 88 # define VBOX_EVENT_COUNT 2 89 90 # endif 88 91 89 92 HANDLE *slirp_get_events(PNATState pData); -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r15244 r15266 654 654 } 655 655 656 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 657 void slirp_select_poll(PNATState pData, int fTimeout, int fIcmp) 658 #else 656 659 void slirp_select_poll(PNATState pData, fd_set *readfds, fd_set *writefds, fd_set *xfds) 660 #endif 657 661 { 658 662 struct socket *so, *so_next; … … 700 704 } 701 705 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 702 if ( !readfds && !writefds && !xfds)706 if (fTimeout) 703 707 return; /* only timer update */ 704 708 #endif … … 908 912 #if defined(VBOX_WITH_SLIRP_ICMP) 909 913 # if defined(RT_OS_WINDOWS) 910 sorecvfrom(pData, &pData->icmp_socket); 914 if (fIcmp) 915 sorecvfrom(pData, &pData->icmp_socket); 911 916 # else 912 917 if (pData->icmp_socket.s != -1 && FD_ISSET(pData->icmp_socket.s, readfds))
Note:
See TracChangeset
for help on using the changeset viewer.