Game Development Reference
In-Depth Information
method once you're done writing out all data for the frame. In the end, though, you'll
want to ensure that you have some kind of synchronization in place to ensure that
the StoreAsync() method is complete before you try to write any more. The same
goes for the LoadAsync() method; do not try to load while the reader is still loading
a previous request.
You might wonder, well, why not make these synchronous? Well in our case, we
want the game client to continue rendering and updating so that the player doesn't
notice an issue even if something is slowing the transfer. We need to output a new
frame every 16 to 33 milliseconds; so even if we don't transmit a new message every
frame, we should still render as normal.
Search WWH ::




Custom Search