diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-03-09 13:29:24 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-03-20 23:44:57 +0800 |
| commit | 458d92bd4f7bcc61a3ccb1467d5767bd8daceff2 (patch) | |
| tree | e8ac2df7d1ef254ffb6cb5001fc42fc36adb129e /src/session.hpp | |
| parent | 880b6a9275030515e11fdfeb3b6fc074bca9322d (diff) | |
style: remove random const, reorganize stuff
Diffstat (limited to 'src/session.hpp')
| -rw-r--r-- | src/session.hpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/session.hpp b/src/session.hpp index d5fb7e6..669da18 100644 --- a/src/session.hpp +++ b/src/session.hpp @@ -8,20 +8,22 @@ class CSession { public: + CSession(Hyprutils::OS::CFileDescriptor m_sockfd); + ~CSession(); + struct SRecvData { char data[1024] = {0}; ssize_t dataSize = sizeof(data); bool good = true; }; - CSession(Hyprutils::OS::CFileDescriptor m_sockfd); - ~CSession(); - std::string getName() const; - bool isValid() const; + + std::string getName(); + bool isValid(); SRecvData read(); SRecvData read(const std::string &msg); - bool write(const std::string &msg, eFormatType type) const; + bool write(const std::string &msg, eFormatType type); template <typename... Args> - bool write(eFormatType type, std::format_string<Args...> fmt, Args &&...args) const; + bool write(eFormatType type, std::format_string<Args...> fmt, Args &&...args); void run(); void setSelf(std::pair<std::jthread, std::shared_ptr<CSession>> *self); @@ -35,10 +37,10 @@ class CSession { std::string m_name; void recvManager(); bool registerSession(); - void onConnect() const; - void onDisconnect() const; - void onErrno(eEventType) const; - void onRecv(const SRecvData &data) const; - void onSend(const std::string &msg) const; + void onConnect(); + void onDisconnect(); + void onErrno(eEventType); + void onRecv(const SRecvData &data); + void onSend(const std::string &msg); friend class CSessionManager; }; |
