diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-06-21 20:27:35 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-06-22 11:13:20 +0800 |
| commit | 80b51b45089d2cf3aa5670454d1c971e4adff18c (patch) | |
| tree | a75b62e7e217f9d40daa80bd196325ca4cab818c /include/libsock | |
| parent | 2c466d30464b566c471a89c5528d768be7729445 (diff) | |
API(server/clients): runLoop, resumeHistory
Diffstat (limited to 'include/libsock')
| -rw-r--r-- | include/libsock/server/client.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/libsock/server/client.hpp b/include/libsock/server/client.hpp index 0579a38..f7d9889 100644 --- a/include/libsock/server/client.hpp +++ b/include/libsock/server/client.hpp @@ -43,7 +43,8 @@ class Client { template <typename... Args> bool write(std::format_string<Args...> fmt, Args &&...args); - void run(); + void resumeHistory(); + void runLoop(bool resumeHistory = true, std::optional<std::function<std::any(const SRecvData &)>> cb = std::nullopt); bool isValid(); @@ -61,7 +62,7 @@ class Client { std::optional<std::string> m_szReading = std::nullopt; - void recvLoop(); + void recvLoop(std::optional<std::function<std::any(const SRecvData &)>> cb = std::nullopt); friend class Clients; }; |
