It seems that TCPs recvmsg/sendmsg and ioctl for SIOCINQ/SIOCOUTQ do not check to make sure the socket is connected. I was unable to find a place that does check to make sure the socket is connected
And what is the problem with that? If the socket is in the process of connecting (SYN_SENT or SYN_RECV) then SIOCINQ/SIOCOUTQ will report zero. If closed or closing, it will report zero since by defi
Hello David, This makes sense. I interpreted the The man page for tcp(4) to say that FIONREAD and TIOCOUTQ would leave errno equal to EPIPE if the socket was closed. In the code I see how sendmsg/rec
.B FIONREAD, TIOCINQ Returns the amount of queued unread data in the receive buffer. Argument is a pointer to an integer. I honestly don't see how it can be interpreted to state that. -Andi -- This i