I need to write a UDP client in C that generates traffic that will have a sending rate of Ron for a time of Ton and stop sending anything for a time Toff and repeat again. So, the cross traffic is periodic. The problem that I am having is how to make the client to send at a constant rate Ron. I thought about using the functions sendto and usleep. However, sendto does not have a way to specify at what rate you want to send data.
Thanks in advance.