summaryrefslogtreecommitdiff
path: root/src/sessionManager.hpp
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-03-07 18:02:11 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-03-20 23:44:57 +0800
commit7a56113d69c5a56ea333f87c5d67cd5a371aa090 (patch)
tree7b3873aabf9d35abeac7e4970935cb9f185ccaa7 /src/sessionManager.hpp
parent3972c5f76483bf5f64bcf19685ee391c4d6b1a9b (diff)
fix: session not disconnected properly
perf: use server sockfd directly instead of a dupe of it
Diffstat (limited to 'src/sessionManager.hpp')
-rw-r--r--src/sessionManager.hpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/sessionManager.hpp b/src/sessionManager.hpp
index 2dd825a..0b447b5 100644
--- a/src/sessionManager.hpp
+++ b/src/sessionManager.hpp
@@ -1,5 +1,6 @@
#pragma once
+#include "format.hpp"
#include "session.hpp"
#include <memory>
#include <thread>
@@ -9,11 +10,12 @@ class CSessionManager {
public:
CSessionManager();
~CSessionManager();
- void enterLoop();
- void newSession(Hyprutils::OS::CFileDescriptor sockfd);
- void broadcast(const std::string &message) const;
- void kick(const CSession *session) const;
- void addSession(const CSession &session);
+ void enterLoop();
+ std::pair<std::jthread, std::shared_ptr<CSession>> *newSession(Hyprutils::OS::CFileDescriptor sockfd);
+ void broadcast(const std::string &message, eFormatType type = {}) const;
+ void kick(const CSession *session) const;
+ void addSession(const CSession &session);
+ void removeSession(std::pair<std::jthread, std::shared_ptr<CSession>> *session);
private:
std::vector<std::pair<std::jthread, std::shared_ptr<CSession>>> m_vSessions;