I'm writing code to send and receive packets. UDP packets are often ignored, so I am writing a retransmission code. The way I'm trying to make it is as follows.
When a UDP packet is sent, the recv() function waits for a response. Then, if there is no data coming in for 1 second in the recv function (use settimeout(1.0)), the first packet is sent again. Repeat this process through an infinite loop. This uses the settimeout() method of recv(). I don't know how to make it.