int main(int argc, const char * argv[]) { if (argc == 1) { std::cout << "Usage: rshd [port]" << std::endl; return 0; } try { make_daemon(); io_queue queue; sshd_daemon deamon(queue, std::stoi(argv[1])); queue.watch_loop(); } catch (std::runtime_error const& error) { std::cout << error.what() << std::endl; } return 0; }
int SpiderApp::initApp(int argc, char *argv[]) { /*处理参数*/ if (initArgc(argc, argv) == 0) { // return 0; } /*读取配置文件*/ ConfigParser::GetInstance()->loader(CONF_PATH); /*处理是否以守护进程运行*/ if (isDeamon) { deamon(); } /*载入所有模块*/ //待完成 // }