I am using this server code:
[...]
while(1){
bzero(buffer,256);
n = read(newsockfd,buffer,255);
if (n < 0) error("ERROR reading from socket");
cout << "Message " << buffer << n << endl;
}
[...]
On the client side, I have, among other things (this is Java):
out.writeUTF("MOVE");
This line repeats itself several times. But, when I do that, the output I get is:
Message 6
So the n is correct, but the buffer is empty.
I have also tried:
out.writeBytes("MOVE");
And sometimes I get this:
Message MOVE4
But sometimes I get this:
Message M1
Message O1
Message V1
Message E1
So, what can I do? Thank you so much.