Hi,

I have put my server socket into non-blocking mode and added a watcher.
Everything works fine. My callback gets called and I call accept. However,
when accept returns -1 with errno EMFILE (too many files open), I just exit
out of my callback. But it is called again immediately.

I suppose at this point I could count the number of file descriptors my
program is using, stop the watcher, and when one of my file descriptors is
closed, start accepting again. Not only is that tedious, but I'm not even
sure it works as I think the reason I got into this state is old crashed
clients in time-wait state.

Instead, is there some way I can tell the callback to be called less often
(say every second)? I suppose I could just stop the callback and create a
timer to start it again... or is there a better way?

I don't want to up the ulimit at this point - I just want to properly handle
this condition.

Cheers,
Eric
_______________________________________________
libev mailing list
libev@lists.schmorp.de
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to