UDP + recv() + MSG_PEEK = WSAEMSGSIZE
I was wondering if it is safe to "peek" at the buffer when using UDP as the selected protcol in Winsock. The recv() function fails with WSAEMSGSIZE, so I'm wondering if the data is lost.
Thanks.
::EDIT::
I just tested the application by ignoring the WSAEMSGSIZE error and the peek worked successfully and then another call after that to receive the data without MSG_PEEK worked properly!
Why would it report this error if it isn't true? I'm also curious to know why data that you don't receive in a single call is erased from the receive buffer. For example, if there is 10 bytes in the receive buffer and I only receive 5 bytes in a single call to recv(), the other remaining 5 bytes are erased?? Why would UDP do this?
Thanks.
Last edited by MrDoomMaster; October 19th, 2005 at 10:28 PM.
--MrDoomMaster
--C++ Game Programmer
Don't forget to rate me if I was helpful!