What can cause a “Resource temporarily unavailable” on sock send() command

c, linux, sockets, unix

Solution

`"Resource temporarily unavailable"` is the error message corresponding to `EAGAIN`, which means that the operation would have blocked but nonblocking operation was requested. For `send()`, that could be due to any of:

- explicitly marking the file descriptor as nonblocking with `fcntl()`; or

- passing the `MSG_DONTWAIT` flag to `send()`; or

- setting a send timeout with the `SO_SNDTIMEO` socket option.

Problem

What can cause a `Resource temporarily unavailable` error on a socket `send()` command? The socket is setup as `AF_UNIX, SOCK_STREAM`. It works most of the time, but occasionally gets this error. The receiving end of the socket appears to be working properly. I know this isn't very detailed, but I'm just looking for general ideas. Thanks!

Original source

Related problems