I'm working on an 8-user app that runs over a wi-fi network using an XML socket. All of the hardware is located inside a medium sized room in a school building.

At the start of the app, each user can select 1 role from a pool of 8. However, the socket connection runs at less than realtime, probably because of latency from the wi-fi, so it's possible for two users to make the same selection at the same time. How would I prevent this? Would time stamping help?

Sorry for the noobish question, I haven't got a lot of exPerience and understanding of networked applications, even ones as simple as this one.