I'm in openSUSE Linux (v15.1), using berkeley sockets.
I have a "sender" app that sends a datagram each second. Another "receiver" app that reads all the time. It works well.
But If I have both turned off, send some datagrams from the sender, turn it off... and then activate the receiver, nothing is there to be read. So the datagrams are gone.
I need this because I'm reading the datagrams at a given speed and I need to be sure that at least one of them stays there.
I found that there's a "receive buffer" set on the socket, and you can read and change information on input and output buffers using "getsockopt" and change them using "setsockopt".
But when I read the socket, even when I know there was something sent, there's nothing. So how long are the packages stored there?. I couldn't find any way to check or change this in "getsockopt" options.