Thats getting more into styles of multiplayer engines. There are probably many ways to do this, but I have had success with 2.
1: Send only the keypress of the other player, and simulate what he did on your own calculator
2: In simpler games, send the value of a single position or value
You need to set up your engine so that there can't be any mistake calculation what information is being sent. If you need to send large numbers of bytes, you cold either set up a List transfer program (not that bad), or set up a 'link chain' where the calculator sync up and transfer raw, pre-determined data across. This could be done, butt a bit unreliable. The best engine I have come up with so far works like this:
//Do player 1 code
//Do player 2 code
This loop will never get unsynced, because when one calculator is simulating, the other is waiting for the other to get finished. They kind of take turns going back and forth. It slows your loop down a bit, but it is very useful in that you don't need any syncing code or anything, only data transfer.
You could transfer more than one variable with something like this
although you might need to put in some delays between the send comands to make sure the other calc has time to finish his getting and more on to the next get.