Can single-buffer blocking WSASend deliver partial data?
Posted
by
CodeAngry
on Stack Overflow
See other posts from Stack Overflow
or by CodeAngry
Published on 2014-04-02T19:30:45Z
Indexed on
2014/05/29
3:27 UTC
Read the original article
Hit count: 182
I've pretty much always used send() with sockets and now I'm moving onto the WSA functions. With send(), I have a sendall() helper that ensured all data is delivered even if it didn't happen in one try and a partial send occurred on first call.
So, instead of learning the hard way or over-complicating code when I don't have to, decided to ask you:
Can a blocking
WSASend()send partial data or does it send everything before it returns or fails? Or should I check the bytes sent vs. expected to send and keep at it until everything is delivered?
ANSWER: Overlapped WSASend() does not send partial data but if it does, it means the connection has terminated. I've never encountered the case yet.
© Stack Overflow or respective owner