diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-03-09 13:03:17 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-03-20 23:44:57 +0800 |
| commit | 880b6a9275030515e11fdfeb3b6fc074bca9322d (patch) | |
| tree | 7679d12347beac15c91f050748c211ccf8bd556b /src/main.cpp | |
| parent | 694dd95da005d09962fec05ee48c8e985782671b (diff) | |
sessionManager: run in a jthread, for prep of inputManager
refactor(main)!: move main infra to oop chatServer
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp index e7d9780..8b800dd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,9 +1,13 @@ -#include "server.hpp" -#include "sessionManager.hpp" +#include "chatServer.hpp" +// TODO: ARGC, ARGV. the CServer ctor should take a port number int main() { - g_pServer = std::make_unique<CServer>(8080); - g_pSessionManager = std::make_unique<CSessionManager>(); - g_pSessionManager->enterLoop(); - return 0; + g_pChatServer = std::make_unique<CChatServer>(); + g_pChatServer->start(); + + // died + g_pChatServer->cleanup(); + g_pChatServer.reset(); + + return 0; } |
