From b075eb7c98e45972b2ff79048cfde8f1469b00c7 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 22 Jun 2025 16:14:17 +0800 Subject: fix(server/clients): async initialization API: newClient no longer take any args API: manual isValid() check is needed to interact with client now --- include/libsock/server/client.hpp | 1 + include/libsock/server/clients.hpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'include/libsock') diff --git a/include/libsock/server/client.hpp b/include/libsock/server/client.hpp index 591bc2a..1d07837 100644 --- a/include/libsock/server/client.hpp +++ b/include/libsock/server/client.hpp @@ -48,6 +48,7 @@ class Client { bool isValid(); private: + void init(); Client(SP server, SP clients, bool track = false, bool oneShot = true); WP m_self; diff --git a/include/libsock/server/clients.hpp b/include/libsock/server/clients.hpp index b18c043..dac5dd1 100644 --- a/include/libsock/server/clients.hpp +++ b/include/libsock/server/clients.hpp @@ -24,7 +24,7 @@ class Clients : public std::enable_shared_from_this { static SP create(WP server); ~Clients(); - SP newClient(std::function &)> loopFunc = [](const WP &) { ; }); + SP newClient(); void broadcast(const std::string &msg, std::optional> self = std::nullopt); // second param only specified when we // want to exclude the sender -- cgit v1.2.3