diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-03-11 19:09:47 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-03-20 23:44:59 +0800 |
| commit | e702fc9cdbe9808a8cc7a60bf3c414f874d81d02 (patch) | |
| tree | f44b7db3600671e21a9ac07cce4e7a6f6239082f /src/sessionManager.cpp | |
| parent | b3fc81f22c0f00636611ef36e70138607635c2ff (diff) | |
session: get/use IP and port on connect
Diffstat (limited to 'src/sessionManager.cpp')
| -rw-r--r-- | src/sessionManager.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
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 <algorithm> #include <unistd.h> @@ -26,8 +25,8 @@ CSessionManager::~CSessionManager() { log(SYS, "SessionManager: bye"); } -std::pair<std::jthread, std::shared_ptr<CSession>> *CSessionManager::newSession(Hyprutils::OS::CFileDescriptor sockfd) { - std::shared_ptr session = std::make_shared<CSession>(std::move(sockfd)); +std::pair<std::jthread, std::shared_ptr<CSession>> *CSessionManager::newSession() { + std::shared_ptr session = std::make_shared<CSession>(); 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<std::jthread, std::shared_ptr<CSession>> *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 { |
