ACCEPTOR ERROR: resource is temporarily unavailable

I am trying to create a single threaded server in linux (red-hut) in C that will listen on multiple sockets.

I need to use non-blocking sockets when I set flags as non-blocking:

int flagss = fcntl(socketfds[j],F_GETFL,0); 
flagss |= O_NONBLOCK;
fcntl(socketfds[j],F_SETFL,flagss);

I get:

ERROR on accept: Resource temporarily unavailable

Otherwise, everything works fine.

+5
source share
1 answer

The resource is temporarily unavailable to EAGAIN, and this is not an error. This means: ā€œI have no answer for you right now, and you told me not to wait, so I’m coming back without an answer.ā€

, , accept errno , , . , select () poll ( , , , - unix ) epoll ( , Linux -) .

, poll ( ), .

+12

All Articles