23,120
社区成员
发帖
与我相关
我的任务
分享
struct evhttp *http_server = NULL;
event_init();
http_server = evhttp_start(app_config.addr, app_config.port);
if (http_server == NULL) {
kill(0, SIGTERM);
exit(-1);
}
fprintf(stdout, "app listen on %s:%d\n", app_config.addr, app_config.port);
evhttp_set_timeout(http_server, app_config.timeout);
evhttp_set_gencb(http_server, generic_request_handler, NULL);
event_dispatch();
evhttp_free(http_server);