From c76c01d1fd2ccbf91a6c3e0a120ed68c37ff106b Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 22 Jun 2025 17:38:23 +0800 Subject: API(server/clients:newClient): allow setting independent clients to wait fix!(server/clients:newClient): pass m_track also --- include/libsock/server/clients.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'include/libsock/server/clients.hpp') diff --git a/include/libsock/server/clients.hpp b/include/libsock/server/clients.hpp index dbe7099..4b67c23 100644 --- a/include/libsock/server/clients.hpp +++ b/include/libsock/server/clients.hpp @@ -21,10 +21,10 @@ struct SData { class Clients : public std::enable_shared_from_this { public: - static SP create(WP server, bool wait = false); + static SP create(WP server); ~Clients(); - SP newClient(std::function &)> cb = [](SP) {}); + SP newClient(std::function &)> cb = [](SP) {}, bool track = true, bool wait = false); void broadcast(const std::string &msg, std::optional> self = std::nullopt); // second param only specified when we // want to exclude the sender @@ -38,13 +38,11 @@ class Clients : public std::enable_shared_from_this { std::vector getDatas() const; private: - Clients(bool wait = false); - + Clients(); void broadcast(const SData &msg); std::vector>> m_vClients; std::vector m_vDatas; - bool m_wait; WP get(); -- cgit v1.2.3