예제 #1
0
파일: test2.cpp 프로젝트: happyj/ssdb
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;
}
예제 #2
0
파일: test.cpp 프로젝트: ezhangle/ssdb
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;
}