I'm also facing the same problem.
In my case the sender always close the connection after the whole message has been sent.
But in the receiver side it's missing information.
I don't know why this is happening. I've tried several buffer size, several methods (such as Recv(), Read() or the mentioned above)...
maybe this help you: when disconnected you should write the buffer to the complete buffer
But still it's not enough for me.