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 --- src/server/client.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/server/client.cpp') diff --git a/src/server/client.cpp b/src/server/client.cpp index e84a654..aa2cdd1 100644 --- a/src/server/client.cpp +++ b/src/server/client.cpp @@ -23,7 +23,9 @@ Client::Client(SP server, SP clients, bool track, bool oneShot) throw std::runtime_error("server:client: ClientManager doesn't exist"); if (m_wpServer.expired()) throw std::runtime_error("server:client: Server doesn't exist"); +} +void Client::init() { m_sockfd = std::make_shared(accept(m_wpServer.lock()->getSocket()->get(), reinterpret_cast(&m_addr), &m_addrLen)); // if this is in the init list, it will run before // m_addrLen, so it won't work :/ -- cgit v1.2.3