i initialise EventBase on master process. $this->base = new EventBase();
i add signal event like that on master process:
$event = new Event($this->base, SIGTERM, Event::SIGNAL | Event::PERSIST , array($this, "EventTERM")); $event->add();
i initialise another eventbase
$this->listenerbase = new EventBase();
i initialise EventListener on socket in master process on this base. $listener = new EventListener($this->listenerbase, [$this, 'ev_accept'], $this, EventListener::OPT_CLOSE_ON_FREE | EventListener::OPT_REUSEABLE, -1, "localhost:80"))
i fork and in the child i reinit the EventListener EventBase and try to unset the first EventBase who i've attached the signal SIGTERM and add new signal event SIGTERM on the listenerbase then dispatch on them.
but notice a the message: Notice: Event::add(): Added a signal to event base 0x1d43f30 with signals already added to event_base 0x1d3aec0. Only one can have signals at a time with the epoll backend.
when searching on the net about this message i found similar use of signal handler on libevent list: http://archives.seul.org/libevent/users/Mar-2011/msg00008.html http://sourceforge.net/p/levent/bugs/224/
the probleme are in fact that cannot free completly the master process eventbase on the child...
i've tryed to reinit, and delete/free all event, and unset the eventbase object... and force collecting garbage...
and the notice while continue to appeare...
to abel to completely free the eventbase to avoid this notice message. in the object version of this extension the freeing of the eventbase rely on the destruction of the object... adding free method on the eventbase to explicitly free the object while resolve the probleme i think...