diff options
Diffstat (limited to 'src/session.hpp')
| -rw-r--r-- | src/session.hpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/session.hpp b/src/session.hpp index 9dc3f0f..0c5e4f9 100644 --- a/src/session.hpp +++ b/src/session.hpp @@ -1,6 +1,7 @@ #pragma once #include "FileDescriptor.hpp" +#include "format.hpp" #include <string> class CSession { @@ -15,9 +16,11 @@ class CSession { std::string getName() const; bool isValid() const; SRecvData read(); - SRecvData read(std::string &msg); - bool write(const std::string &msg) const; - void run(); + SRecvData read(const std::string &msg); + bool write(const std::string &msg, eFormatType type) const; + template <typename... Args> + bool write(eFormatType type, std::format_string<Args...> fmt, Args &&...args) const; + void run(); private: enum eEventType { @@ -31,6 +34,7 @@ class CSession { void onConnect() const; void onDisconnect() const; void onErrno(eEventType) const; - void onRecv(SRecvData &data) const; + void onRecv(const SRecvData &data) const; + void onSend(const std::string &msg) const; friend class CSessionManager; }; |
