Current udp packets queue length
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,
http://www.daemon-systems.org/man/ioctl.2.html
From outside of the server (command line), you can do
netstat -uln
which will show you the length of all listening udp sockets.
精彩评论