summaryrefslogtreecommitdiff
path: root/src/session.hpp
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-03-11 19:09:54 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-03-20 23:44:59 +0800
commit7950f626f9b47761864c7f27eecf77c7204e6828 (patch)
tree2f6830148bd2d546d29defa583893e4a5807d080 /src/session.hpp
parente702fc9cdbe9808a8cc7a60bf3c414f874d81d02 (diff)
bump: compile_commands
Diffstat (limited to 'src/session.hpp')
-rw-r--r--src/session.hpp43
1 files changed, 21 insertions, 22 deletions
diff --git a/src/session.hpp b/src/session.hpp
index 235870c..82eca9c 100644
--- a/src/session.hpp
+++ b/src/session.hpp
@@ -19,18 +19,17 @@ class CSession {
};
std::string getName();
- void setSelf(std::pair<std::jthread, std::shared_ptr<CSession>> *self);
+ void setSelf(std::pair<std::jthread, std::shared_ptr<CSession>> *self);
- SRecvData read();
- SRecvData read(const std::string &msg);
- bool write(const std::string &msg, eFormatType type);
+ SRecvData read();
+ SRecvData read(const std::string &msg);
+ bool write(const std::string &msg, eFormatType type);
template <typename... Args>
bool write(eFormatType type, std::format_string<Args...> fmt, Args &&...args);
void run();
- bool isValid();
-
+ bool isValid();
private:
enum eEventType : std::uint8_t {
@@ -39,22 +38,22 @@ class CSession {
};
std::pair<std::jthread, std::shared_ptr<CSession>> *self;
- Hyprutils::OS::CFileDescriptor m_sockfd;
- sockaddr_in m_addr;
- socklen_t m_addrLen = sizeof(m_addr);
- std::string m_name;
- char m_ip[INET_ADDRSTRLEN];
- int m_port;
-
- void recvLoop();
- bool registerSession();
-
- void onConnect();
- void onDisconnect();
- void onErrno(eEventType);
- void onRecv(const SRecvData &data);
- void onSend(const std::string &msg);
- void onShutdown();
+ Hyprutils::OS::CFileDescriptor m_sockfd;
+ sockaddr_in m_addr;
+ socklen_t m_addrLen = sizeof(m_addr);
+ std::string m_name;
+ char m_ip[INET_ADDRSTRLEN];
+ int m_port;
+
+ void recvLoop();
+ bool registerSession();
+
+ void onConnect();
+ void onDisconnect();
+ void onErrno(eEventType);
+ void onRecv(const SRecvData &data);
+ void onSend(const std::string &msg);
+ void onShutdown();
friend class CSessionManager;
};