...how exactly do you ensure that the Server always sends the data after the Client has entered a wait state for the data?
As in, if I have the Server write something and the Client read something from the server, how do I always ensure that the Server didn't write before the server began waiting to read?
The lazy solution is to have the thread in the server sleep for 2000 ms or so before it sends across the data, so that you can pretty much guarantee that by the time those 2000 ms are up the Client would have reached the "ready to read data from the server" stage.
But that's a crappy solution. How exactly is this kind of stuff handled?