Winsock, weird sideeffect
I got this odd error where if I send some data from a client to a server the message is received but I also get a number of empty messages, the same amount as the nr of letters in the message (in the example below, the string "Hello" gets 5 empty messages.
It's a non-blocking system, the client sends simply using send() and the server's recieve-part looks like this:
As an example, if the client sends the string "Hello" to the server it would receive these messages:
Result = recv(W, &Char, 1, 0);
if(Result == SOCKET_ERROR)
if(WSAGetLastError() == WSAEWOULDBLOCK) break;
ErrorMessage = "recv() failed!";
if(Result < 1) break;
String = "MSG: ";
String += &Buffer;
Prolly some stupid error, but I just can't find it...