I think you're misinterpreting how $sockbr is used

$sockbr returns the number of bytes you got from the very last /sockread call, which reads from the queue buffer.

If there is nothing in the queue, and nothing left to read then it naturally returns 0.

This is normal. Your results reflect this behaviour. You'll see that you loop 10 times and that the entire queue is read in the very first /sockread each time, leaving nothing left to read for the next 9 sockreads.

as far as .rcvd goes, you correctly point out that it updates after the sockread event only.. so as I mentioned, to keep score inside a specific sockread event you have to count with $sockbr.

I also gave you the code to do this. Where does the confusion lie?

- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"