Thanks abachler, on reviewing the file handling code, there was a potential bug but that wasn't causing the issue in this case.
The problem Salem said (which is obvious now). Assuming the buffer was always full.
So I have implemented the following code in the client. Seems dodgy is there a better way to do this?
Code:
while (br = recv(remoteConnection->socketfd, (char*) &nsp->mp, sizeof *nsp, MSG_PEEK) < sizeof *nsp){}
br = recv(remoteConnection->socketfd, (char*) &nsp->mp, sizeof *nsp, NULL);
It dosnt seem good to be infinite looping until a full buffer (which is a packet for me) is received.
Also is using MSG_PEEK a good idea? Is there any way to get the size of the msg stack without actually reading it?