Winsock recv is screwing with my variables!!

Started by
19 comments, last by csolar 21 years, 1 month ago
I just read an article on why it is bad to use MSG_PEEK. To sum it up, it is because it is an unnecessary performance hit and it could also return incorrect values (I have never run into the later of the problems). However, Here is a link to that article from Microsoft. After reading the article I would suggest removing it from the previous code. Instead, since your writing the server side as well, you know what the maximum buffer size your server will send is beforehand so make sure you have at least that much on your client side buffer.

Thanks to Digitalfiend for bringing this to my attention.

Edit:
Upon re-reading the article, I think the warning was more geared towards the idea that someone may use recv with MSG_PEEK instead of the select function(or equivilent). I agree it is an unnecessary performance hit, but if used properly it doesn't sound like it would be that bad for debugging purposes.

[edited by - evillive2 on March 10, 2003 3:17:15 PM]
Evillive2

This topic is closed to new replies.

Advertisement