CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 15

Threaded View

  1. #1
    Join Date
    Feb 2004
    Location
    Texas, USA
    Posts
    1,206

    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured