I'm writing a multiplayer game (obviously using UDP sockets. note: using winsock 2.2). The server code reads something like this:
while(run)
{
select(0, &readSockets, NULL, NULL, &t)
if(FD_ISSET(serverSocket, &readSockets))
{
printf("%s\n","Data receieved");
//recvfrom over here
}
FD_SET(serverSocket, &readSockets);
}
While this is not receiving data from my client, this is:
recvfrom(serverSocket, buffer, sizeof(buffer), 0, &client, &client_size);