From eb78b04ca2f4fc334365f2a26537691aa1c91f48 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Thu, 19 Jun 2025 18:47:32 +0800 Subject: API(session/clients:newClient): allow custom server ptr --- include/libsock/server/clients.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/libsock/server') diff --git a/include/libsock/server/clients.hpp b/include/libsock/server/clients.hpp index 8eccbb7..a80fb4a 100644 --- a/include/libsock/server/clients.hpp +++ b/include/libsock/server/clients.hpp @@ -1,6 +1,7 @@ #pragma once #include "../types.hpp" +#include "server.hpp" #include #include #include @@ -24,7 +25,7 @@ class Clients : public std::enable_shared_from_this { static SP create(); ~Clients(); - WP newClient(std::optional)>> cb = std::nullopt); + WP newClient(SP server = pServer, std::optional)>> cb = std::nullopt); 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