check amount of buffered data in unix domain datagram socket

46 views Asked by At

Is there a utility that shows the number of bytes unread (by the server) in a unix domain datagram socket?

The Recv-Q estimates using ss -a do not seem to work here. For example, I know for a fact that the client nc -u -U ~/temp.socket has written a lot more data than what is displayed with ss above.

$nc -u -U ~/temp.socket
Unread Str
More content that never updates SS

I checked ss after the first and second line, notice the contents don't change and only reflect the size of first line.

$ sudo ss -ax | grep temp.socket
u_dgr ESTAB  11     0                                                temp.socket 1225011            * 0             

$ sudo ss -ax | grep temp.socket
u_dgr ESTAB  11     0   
temp.socket 1225011   * 0  

Is there a way to see how much data is buffered from either transmit or the receive side?

I tried getting this data from the server itself via ioctl, and it only returns the first set of unread data vs. total outstanding bytes.

int bytes_left;
ioctl(fd, FIONREAD, &bytes_left);
0

There are 0 answers