From 2320470d342db4cb5ae0ae717dfc5ac94bd3f2d2 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 21 Jun 2025 21:18:28 +0800 Subject: internal(server): remove return of std::any for callbacks use bool for cases for premature return --- include/libsock/server/client.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'include/libsock/server/client.hpp') diff --git a/include/libsock/server/client.hpp b/include/libsock/server/client.hpp index f7d9889..2549ef5 100644 --- a/include/libsock/server/client.hpp +++ b/include/libsock/server/client.hpp @@ -3,7 +3,6 @@ #include "../types.hpp" #include "clients.hpp" #include "server.hpp" -#include #include #include #include @@ -37,14 +36,14 @@ class Client { const std::string &getIp() const; bool isAdmin() const; - UP read(std::optional> cb = std::nullopt); - UP read(const std::string &msg, std::optional> cb = std::nullopt); - bool write(const std::string &msg, std::optional> cb = std::nullopt); + UP read(std::optional> cb = std::nullopt); + UP read(const std::string &msg, std::optional> cb = std::nullopt); + bool write(const std::string &msg, std::optional> cb = std::nullopt); template bool write(std::format_string fmt, Args &&...args); void resumeHistory(); - void runLoop(bool resumeHistory = true, std::optional> cb = std::nullopt); + void runLoop(bool resumeHistory = true, std::optional> cb = std::nullopt); bool isValid(); @@ -62,7 +61,7 @@ class Client { std::optional m_szReading = std::nullopt; - void recvLoop(std::optional> cb = std::nullopt); + void recvLoop(std::optional> cb = std::nullopt); friend class Clients; }; -- cgit v1.2.3