src/mn-masterd/main.c
const char*
master_start_cb()
{
    struct ev_loop *loop;
    ev_signal       sigint_listen;
    ev_signal       sigterm_listen;
    ev_io           io_listen;
    
    if (!(loop = ev_default_loop(EVFLAG_AUTO)))
        return 1;

    syslog(LOG_INFO, "listening on %s:%hd",
            inet_ntoa(srv.addr.sin_addr),
            ntohs(srv.addr.sin_port));

    ev_signal_init(&sigint_listen,
            &nol_m_ev_sigint, SIGINT);
    ev_signal_init(&sigterm_listen,
            &nol_m_ev_sigterm, SIGTERM);
    ev_io_init(&io_listen, &nol_m_ev_conn_accept,
            srv.listen_sock, EV_READ);

    /* catch SIGINT */
    ev_signal_start(loop, &sigint_listen);
    ev_signal_start(loop, &sigterm_listen);
    ev_io_start(loop, &io_listen);

    ev_loop(loop, 0);
    close(srv.listen_sock);
    ev_default_destroy();

    closelog();
    return 0;
}
/** 
 * start the event loop and begin accepting
 * connections
 *
 * called by nol_daemon_launch()
 **/
start the event loop and begin accepting
connections


start the event loop and begin accepting connections
const char*
master_start_cb()
{
    struct ev_loop *loop;
    ev_signal       sigint_listen;
    ev_signal       sigterm_listen;
    ev_io           io_listen;
    if (!(loop = ev_default_loop(EVFLAG_AUTO)))
        return 1;
    syslog(LOG_INFO, "listening on %s:%hd",
            inet_ntoa(srv.addr.sin_addr),
            ntohs(srv.addr.sin_port));
    ev_signal_init(&sigint_listen,
            &nol_m_ev_sigint, SIGINT);
    ev_signal_init(&sigterm_listen,
            &nol_m_ev_sigterm, SIGTERM);
    ev_io_init(&io_listen, &nol_m_ev_conn_accept,
            srv.listen_sock, EV_READ);
    ev_signal_start(loop, &sigint_listen);
    ev_signal_start(loop, &sigterm_listen);
    ev_io_start(loop, &io_listen);
    ev_loop(loop, 0);
    close(srv.listen_sock);
    ev_default_destroy();
    closelog();
    return 0;
}
const char * master_start_cb ( ) { struct ev_loop * loop ; ev_signal sigint_listen ; ev_signal sigterm_listen ; ev_io io_listen ; if ( ! ( loop = ev_default_loop ( EVFLAG_AUTO ) ) ) return 1 ; syslog ( LOG_INFO , " " , inet_ntoa ( srv . addr . sin_addr ) , ntohs ( srv . addr . sin_port ) ) ; ev_signal_init ( & sigint_listen , & nol_m_ev_sigint , SIGINT ) ; ev_signal_init ( & sigterm_listen , & nol_m_ev_sigterm , SIGTERM ) ; ev_io_init ( & io_listen , & nol_m_ev_conn_accept , srv . listen_sock , EV_READ ) ; ev_signal_start ( loop , & sigint_listen ) ; ev_signal_start ( loop , & sigterm_listen ) ; ev_io_start ( loop , & io_listen ) ; ev_loop ( loop , 0 ) ; close ( srv . listen_sock ) ; ev_default_destroy ( ) ; closelog ( ) ; return 0 ; }
start the event loop and begin accepting
 connections
start the event loop and begin accepting connections
/* catch SIGINT */