int main(int argc, char **argv){ Config conf; conf.set("server.port", "9000"); NetworkServer serv; serv.init(conf); // register command procedure serv.proc_map.set_proc("hello", proc_hello); serv.serve(); return 0; }
int main(int argc, char **argv){ bool is_daemon = false; const char *conf_file = NULL; for(int i=1; i<argc; i++){ if(strcmp(argv[i], "-d") == 0){ is_daemon = true; }else{ conf_file = argv[i]; } } if(conf_file == NULL){ usage(argc, argv); exit(1); } NetworkServer serv; serv.init(conf_file); serv.serve(); return 0; }