What should be expected to happen if we resize the input buffer of a UDP server socket on the fly on a Linux system?
setsockopt(sock, SOL_SOCKET, SO_RCVBUF, ...)
I am particularly interested in these questions:
- If I shrink below what is currently in the buffer, would this simply drop the oldest/newest? datagrams properly, or could it flush everything that's there, or worse could it corrupt data such as truncating a datagram?
- Would shrinking the buffer even save memory or something prevents that memory from being reused by the system?
- Is the behavior predictable or could it behave randomly at times?