From 880b6a9275030515e11fdfeb3b6fc074bca9322d Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 9 Mar 2025 13:03:17 +0800 Subject: sessionManager: run in a jthread, for prep of inputManager refactor(main)!: move main infra to oop chatServer --- src/main.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/main.cpp') 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(8080); - g_pSessionManager = std::make_unique(); - g_pSessionManager->enterLoop(); - return 0; + g_pChatServer = std::make_unique(); + g_pChatServer->start(); + + // died + g_pChatServer->cleanup(); + g_pChatServer.reset(); + + return 0; } -- cgit v1.2.3