To see how well I'm doing in processing incoming data, I'd like to measure the queue length at my TCP and UDP sockets.
I know that I can get the queue size via SO_RCVBUF
socket option, and that ioctl(<sockfd>, SIOCINQ, &<some_int>)
tells me the information for TCP sockets. But for UDP the SIOCINQ
/FIONREAD
ioctl returns only the size of next pending datagram. Is there a way how to get queue size for UDP, without having to parse system tables such as /proc/net/udp
?