I am going to write a TCP server, the client sends me XML message, I am wondering if below condition will happen and how to avoid that:
1) client sends <cmd ...></cmd>
2) sever is busy doing something
3) clients sends <cmd ...></cmd>
4) server does a recv() and put the string to buffer
Will the buffer be filled with <cmd ...></cmd><cmd ...></cmd>
or even worse <cmd ...></cmd><cmd ...
if my buffer is not big enough?
What I want is the TCP stack divides the messages to the same pieces as how clients sent them.
Is it doable?