From f77e0434c66785fc953ababf6a34982b9cf4017a Mon Sep 17 00:00:00 2001 From: SChernykh Date: Fri, 27 Aug 2021 00:19:01 +0200 Subject: [PATCH] Fixed TCPServer startup --- src/tcp_server.inl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tcp_server.inl b/src/tcp_server.inl index af4160e..0454497 100644 --- a/src/tcp_server.inl +++ b/src/tcp_server.inl @@ -53,12 +53,6 @@ TCPServer::TCPServer(allocate_client_callback all m_connectedClientsList = m_allocateNewClient(); m_connectedClientsList->m_next = m_connectedClientsList; m_connectedClientsList->m_prev = m_connectedClientsList; - - err = uv_thread_create(&m_loopThread, loop, this); - if (err) { - LOGERR(1, "failed to start event loop thread, error " << uv_err_name(err)); - panic(); - } } template @@ -197,6 +191,12 @@ void TCPServer::start_listening(const std::string LOGINFO(1, "listening on " << log::Gray() << address); }); + + const int err = uv_thread_create(&m_loopThread, loop, this); + if (err) { + LOGERR(1, "failed to start event loop thread, error " << uv_err_name(err)); + panic(); + } } template