On Thu, Jan 10, 2013 at 10:05 AM, Bo Lorentsen <b...@lue.dk> wrote:

> The thing is ... this works amazingly, until I try to startup this app as
> a daemon (fork). And yes, when i start it as i daemon i make sure to call
> ev::post_fork(), and my default loop starts up as it is supposed to (but
> later or lazy really), without any problems (in its own libev thread), but
> it seems like any socket connections made after the fork between
> ev::post_fork() and ev::default_loop().run() are invalid after calling run.
>

You shouldn't even need post_fork() just to do daemonization.  Just
daemonize first and then initialize libev stuff afterwards.  My first
random guess at your problem would be that you're using some daemonization
library/code written by someone else, and that it closes all open file
descriptors during the process (a common programming error in daemonization
code).  I've use libev in a ton of daemonized C code without issue, as I'm
sure many others have, so it's unlikely to be a bug in libev.
_______________________________________________
libev mailing list
libev@lists.schmorp.de
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to