main.cpp 351 B

12345678910111213141516171819202122232425262728
  1. #include "pch/pch.h"
  2. #include "rpc/ServerImpl.h"
  3. using namespace std;
  4. int main()
  5. {
  6. //初始化日志
  7. CLewaimaiLog log;
  8. log.Init();
  9. //读取配置文件
  10. CConfigReader::ReadConfigFile();
  11. //开启守护进程
  12. if (daemon(0, 0) == -1)
  13. {
  14. exit(EXIT_FAILURE);
  15. }
  16. //初始化服务端监听
  17. ServerImpl server;
  18. server.Run();
  19. return 0;
  20. }