In the server exemple of a game ( using 39 dll ), there is this code , for the part where client listens from incoming messages.
It says if receivemessage is below 0 means there's none, if it's >0 means there is one, but if its =0 it disconnects. Why ? 0 is the value returned automatically when connection is lost ?
Thanks!
while(1)
{
size = receivemessage(sock, 0, buf_in) //Recieve any messages on the player's socket
//If no message than exit the while() loop
if(size < 0) break;
//If socket was closed gracefully
if(size == 0)
{
instance_destroy(); //Then remove the player
break; //And exit loop
}
}











