Winsock2 data loss when in debugger
i am using Winsock2 in conjunction with overlapped I/O. This means i am calling WSARecv with a WSAOVERLAPPED structure and later i wait with WSAWaitForMultipleEvents for data.
开发者_开发百科I made the strange observation that i seem to loose any data that is send to my application while i am halting it with the debugger. I thought this data would pile up somewhere in the OS and then be delivered on the next call to WSARecv.
Is my assumption false?
UDP or TCP?
I assume you ARE using a separate OVERLAPPED structure per call and a separate event per structure.
Bear in mind that it's not especially scalable to use the overlapped I/O with events, it's much easier to simply associate the socket with an I/O Completion Port and skip the whole event thing completely.
精彩评论