http://bugs.winehq.org/show_bug.cgi?id=7929
--- Comment #81 from Erich Hoover ehoover@mines.edu 2009-09-20 12:48:05 --- (In reply to comment #80)
I like this approach Erich.
The problems I see are that select() could wake up with no data to read (ie. packet from wrong IP), and async I/O and IOCP could have similar problems. Fixing these spurious wakeups - if necessary - is pretty hard: eg. select() would have to MSG_PEEK recvfrom() every readable UDP socket and then possibly re-recvfrom() to throw away packets from the wrong IP...
This patch is certainly the "first pass" at handling the issue, and you have definitely raised some valid points. You've already covered how select() would need to be handled (which I would say is "not too bad"). The async I/O appears to use a MSG_PEEK in wineserver, so it could be handled in a similar fashion. I'm not familiar with IOCP though, could you point me to the place in Wine to look into it?