Put A Delay To A Buffer
I have a question about adding a delay into a buffer that I use to communicate between to serial ports on a Linux system.
When serial port 1 receives data, it has to sent it to a buffer and this buffer has to sent the data further to the second serial port.
Now I want to add a delay to the buffer output. So when the buffer gets data it has to keep it there for, lets say 500 miliseconds and then sent it to port two.
Can someone give me an explanation about the things I have to do, to create this delay?
Thanks for your support.
So do you want everything you get in the buffer to always be delayed? If so, just sleep for a half a second before you send. The FAQ covers sleeping. Or, if you're using some of the unix socket functions such as select, just use it to do the sleep for you. (man page)
Closed. Further cross posts will result in deletion.