From e702fc9cdbe9808a8cc7a60bf3c414f874d81d02 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Tue, 11 Mar 2025 19:09:47 +0800 Subject: session: get/use IP and port on connect --- src/sessionManager.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/sessionManager.cpp') diff --git a/src/sessionManager.cpp b/src/sessionManager.cpp index 7b40bc2..d77c0ae 100644 --- a/src/sessionManager.cpp +++ b/src/sessionManager.cpp @@ -1,6 +1,5 @@ #include "sessionManager.hpp" #include "log.hpp" -#include "server.hpp" #include "session.hpp" #include #include @@ -26,8 +25,8 @@ CSessionManager::~CSessionManager() { log(SYS, "SessionManager: bye"); } -std::pair> *CSessionManager::newSession(Hyprutils::OS::CFileDescriptor sockfd) { - std::shared_ptr session = std::make_shared(std::move(sockfd)); +std::pair> *CSessionManager::newSession() { + std::shared_ptr session = std::make_shared(); const auto instance = &m_vSessions.emplace_back(std::jthread(&CSession::run, session), std::move(session)); instance->second->setSelf(instance); return instance; @@ -35,7 +34,7 @@ std::pair> *CSessionManager::newSession( void CSessionManager::run() { while (true) - newSession(Hyprutils::OS::CFileDescriptor{accept(g_pServer->getSocket()->get(), nullptr, nullptr) /* awaits new client/session */}); + newSession(); } void CSessionManager::broadcast(const std::string &msg, eFormatType type) const { -- cgit v1.2.3