I already know how to send information across a network, but I'm not quite sure on how to make sure that the information sent is correctly since I'm using UDP. Here are my current ideas:
-Parity of the Information
One of my thoughts was to send every message with the same parity, and test the parity when the message is received on the client. If the parity is wrong, then have the server send another message. While this would ensure at least some of the corrupted packets to be detected, there's still room for error.
-Information Mode
My other thought was to send 3-7 packets of the same information and have the client use the mode of the information. This would be much more secure, but it might take longer. Also, there's still a small chance that all of the packets would be corrupted, and the information would be wrong anyways.
What would be the best one? Or would neither be the best way to check integrity?
Then again, what are the chances of the packets getting corrupted? I'm guessing it would depend on how far the packet traveled and the quality of the connections. Is it even worth testing the integrity?
You can't tell the difference between a corrupted checksum in an otherwise valid packet, a valid checksum
in an otherwise corrupt packet, or a corrupted checksum in a corrupted packet, but in any case you'd want
to drop the packet anyway.