I'm setting a timeout for the socket using SO_RCVTIMEO
to 10 seconds. This question is specific to a stream socket (TCP). When I call recv(...)
from what I can gather from the man pages, here is what I'm expecting:
errno
of EAGAIN
or EWOULDBLOCK
.errno
is set properly.Is this the correct behavior? I just want to make sure I'm properly understanding the docs.
Thanks! Brett
ETIMEOUT
would be returned. (EAGAIN
or EWOULDBLOCK
are returned on non-blocking sockets if no data is immediately available.) http://pubs.opengroup.org/onlinepubs/9699919799/functions/recv.html
EAGAIN
or EWOULDBLOCK
would be returned for both possibilities mentioned under 2.1 http://man7.org/linux/man-pages/man2/recvmsg.2.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With