Quantcast
Channel: Active questions tagged linux-kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 12244

What is the predictable behavior of changing SOL_SOCKET, SO_RCVBUF on the fly on a UDP socket?

$
0
0

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?

Viewing all articles
Browse latest Browse all 12244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>