TCP was designed to be stream oriented. The receiver doesn't know anything about sent messages/packets. All it sees is a simple stream of bytes.
So you think like "I sent a message", but recv() only received half of it. The fact is, you never sent a message. You sent a bunch of bytes, and you cannot expect all of them to be received by a single call. You could receive them in 1, 2 or many calls; you could receive the end of a previous "message" combined with the beginning of the next one and so on.
The only guarantees are that you will receive the bytes in the same order they were sent and you will never receive 0 bytes until the stream is closed. That's how the network API works and you have to get used to it.