Alright , I have 2 questions for you guys.
1. When I call a recv() in winsock using TCP protcol, will the program wait there until it recieves something, or does it just keep going if it doesn't recieve anything.
2. I'm trying to have my networked games server send data only about 5 times a second, and have the client extrapolate where everyone will be until it recieves new data. Right now, the game runs at 5 FPS, I think because it sits there and waits for the data. In order to fix this, should I send a little bit of info everytime the server updates, that says whether to wait for data, or update autonomously from the server? Here's some psuedo-code for what I'm trying to explain:
//Server Code
if(updatetime)
{
send(timetoupdate);
send(allthedata);
}
if(!updatetime)
{
send(nottimetoupdate);
}
//Client Code
recv(doIupdate);
if(doIupdate)
{
recv(allthedata);
}
if(!doIupdate)
{
Extrapolatestuff();
}
Can anyone clarify this for me?