diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-03-07 18:02:11 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-03-20 23:44:57 +0800 |
| commit | 7a56113d69c5a56ea333f87c5d67cd5a371aa090 (patch) | |
| tree | 7b3873aabf9d35abeac7e4970935cb9f185ccaa7 /src/session.hpp | |
| parent | 3972c5f76483bf5f64bcf19685ee391c4d6b1a9b (diff) | |
fix: session not disconnected properly
perf: use server sockfd directly instead of a dupe of it
Diffstat (limited to 'src/session.hpp')
| -rw-r--r-- | src/session.hpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/session.hpp b/src/session.hpp index 0c5e4f9..d5fb7e6 100644 --- a/src/session.hpp +++ b/src/session.hpp @@ -2,7 +2,9 @@ #include "FileDescriptor.hpp" #include "format.hpp" +#include <memory> #include <string> +#include <thread> class CSession { public: @@ -21,8 +23,10 @@ class CSession { template <typename... Args> bool write(eFormatType type, std::format_string<Args...> fmt, Args &&...args) const; void run(); + void setSelf(std::pair<std::jthread, std::shared_ptr<CSession>> *self); private: + std::pair<std::jthread, std::shared_ptr<CSession>> *self; enum eEventType { READ, WRITE |
