EWOULDBLOCK would be moderately hard to do since you need that info from the kernel and it doesn't give it to you. The best you could do is chedk q lengths with a stat and maybe approximate it. ECONNRESET you probably could do by looking at the err file in the connection directory.