• Advertisement
Sign in to follow this  

Winsock-Overlapped model doubt about rcv buffers

This topic is 3037 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Simple doubt.. Sometimes you can handle all data received on a single buffer( receive, process, receive, process ..) But in the overlapped model, will the buffer contain just the last data received ? That sucks, because you will have to add not just an WSAOVERLLAPED struct per socket, but a recv buffer too..Is that right?

Share this post


Link to post
Share on other sites
Advertisement
Yes that is right, and yes that sucks. However, you can make it suck considerably less if you put the buffer and the WSAOVERLAPPED into one struct (something like struct Blah { WSAOVERLAPPED o; char buf[1024]; };).
The Winsock functions don't care (and don't need to know) that there is a buffer behind the WSAOVERLAPPED, but you have the advantage of getting it all in one chunk.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement