コード例 #1
0
ファイル: x0d.cpp プロジェクト: crnt/x0
void XzeroHttpDaemon::onChild(ev::child&, int)
{
    // the child exited before we receive a SUCCESS from it. so resume normal operation again.
    server_->log(x0::Severity::error, "New process exited with %d. Resuming normal operation.");

    child_.stop();

    // reenable HUP-signal
    if (!hupSignal_.is_active()) {
        server_->log(x0::Severity::error, "Reenable HUP-signal.");
        hupSignal_.start();
        ev_unref(loop_);
    }

    server_->log(x0::Severity::debug, "Reactivating listeners.");
    for (x0::ServerSocket* listener: server_->listeners()) {
        // reenable O_CLOEXEC on listener socket
        listener->setCloseOnExec(true);

        // start accepting new connections
        listener->start();
    }

    server_->log(x0::Severity::debug, "Resuming workers.");
    for (x0::HttpWorker* worker: server_->workers()) {
        worker->resume();
    }
}
コード例 #2
0
ファイル: app1.cpp プロジェクト: TwinkleStars/x0
	~MyServer()
	{
		if (sigterm_.is_active()) {
			ev_ref(loop_);
			sigterm_.stop();
		}
	}