I have a simple UDP socket program in C. The client transmits data to the server and receives acknowledgements. I already know how to configure a timeout so that if 'recvfrom()' doesn't receive anything in a certain period of time the alarm goes off.

HOWEVER, there are a few more situations I need to handle. What if I receive a reply from an unexpected address, or the reply is not formatted correctly? I don't want to retransmit immediately, only when the alarm goes off.

Let me know if I need to clarify.