posted 13 years ago
The easiest thing is to use TCP instead. In practice, manually messing with UDP makes sense only if you're doing someting unusual. If you use UDP directly, you'll need to do the same things as TCP does: assign the sequence numbers to bytes of packets, negotiate the initial sequence numbers between transmitter and receiver, assemble the received packets in order of the sequences, and request retransmission of the lost packets. The retransmission can be skipped, in this case you would just get a playback hiccup when something gets lost. If you transmit at a fixed rate, you can also skip the flow control, otherwise you need it too.