Errno: 11, Resource Temporarily Unavailable

For me, the problem was due to ipV6 packets arriving on a UDP socket bound to a particular port. These were triggering the select() but when I tried to read them using recvfrom() the call returned "Resource temporarily unavailable". I don't need IPV6 for my application so I simply disabled it via sysctl.conf. Problem now gone away!


When calling recvfrom() on a blocking socket and a time out had been set using setsockopt() it is normal to get the error EAGAIN (11) in case the call to recvfrom() timed out (that is: no data was received in the time period specified as time out).

Verbatim from man recvfrom:

RETURN VALUE

...

ERRORS

... .

EAGAIN or EWOULDBLOCK The socket is marked non-blocking and the receive operation would block, or a receive timeout had been set and the timeout expired before data was received. ...

To get around this: Just call recvfrom () again ... ;-)

Tags:

C

Sockets

Udp