Esempio n. 1
0
File: x0d.cpp Progetto: crnt/x0
// stage-2 termination handler
void XzeroHttpDaemon::quickShutdownHandler(ev::sig& sig, int)
{
    log(x0::Severity::info, "%s received. shutting down NOW.", sig2str(sig.signum).c_str());

    if (!child_.pid) {
        // we are no garbage parent process
        sd_notify(0, "STATUS=Shutting down.");
    }

    // default to standard signal-handler
    ev_ref(loop_);
    sig.stop();

    // install shutdown timeout handler
    terminationTimeout_.set<XzeroHttpDaemon, &XzeroHttpDaemon::quickShutdownTimeout>(this);
    terminationTimeout_.start(10, 0);
    ev_unref(loop_);

    // kill active HTTP connections
    server_->kill();
}
Esempio n. 2
0
	void checkStart()
	{
		if (step_ > 0 && !filename_.empty()) {
			evTimer_.start();
		}
	}
Esempio n. 3
0
 tcp_si_map ()
 {
   ev_default_loop (0);
   cleaner.set<tcp_si_map, &tcp_si_map::cleaner_cb> (this);
   cleaner.start (::conf.keepalive / 2, ::conf.keepalive / 2);
 }