summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-06-22 17:21:46 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-06-22 17:21:46 +0800
commit65672b471cdcd43daff8fcbbc6ff5d0d54159785 (patch)
tree336cbcf7518e4d72b5fc0c9fa4f1f7e3885d14f9 /include
parent06ce37648964daa05a01d0105eb8f68eb55a21e0 (diff)
API(server/client:newClient): optional cb function onConnect
Diffstat (limited to 'include')
-rw-r--r--include/libsock/server/clients.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/libsock/server/clients.hpp b/include/libsock/server/clients.hpp
index dac5dd1..cb11e74 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<Clients> {
static SP<Clients> create(WP<Server> server);
~Clients();
- SP<Client> newClient();
+ SP<Client> newClient(std::function<void(SP<Client> &)> cb = [](SP<Client>) {});
void broadcast(const std::string &msg, std::optional<WP<Client>> self = std::nullopt); // second param only specified when we
// want to exclude the sender