I have rather simple UDP server written on c. Sometimes i need to know current length of all udp packets(bytes) queued in socket. As i understand, getsockopt doesn't get such information.
Linux and FreeBSD solutions are both welcome, thanks!
ioctl(FIONREAD, ...)
should be roughly what you are looking for,
From outside of the server (command line), you can do
netstat -uln
which will show you the length of all listening udp sockets.