TCPServer: refactored Client constructor

This commit is contained in:
SChernykh 2022-05-09 19:13:34 +02:00
parent 08ee599f79
commit a4d84e318d
2 changed files with 14 additions and 3 deletions

View file

@ -89,7 +89,7 @@ public:
int m_port;
char m_addrString[64];
std::atomic<uint32_t> m_resetCounter{ 0 };
std::atomic<uint32_t> m_resetCounter;
};
struct WriteBuf

View file

@ -819,10 +819,21 @@ void TCPServer<READ_BUF_SIZE, WRITE_BUF_SIZE>::on_new_client_nolock(uv_stream_t*
template<size_t READ_BUF_SIZE, size_t WRITE_BUF_SIZE>
TCPServer<READ_BUF_SIZE, WRITE_BUF_SIZE>::Client::Client()
: m_owner(nullptr)
, m_prev(nullptr)
, m_next(nullptr)
, m_socket{}
, m_isV6(false)
, m_isIncoming(false)
, m_readBufInUse(false)
, m_numRead(0)
, m_addr{}
, m_port(0)
, m_addrString{}
, m_resetCounter{ 0 }
{
Client::reset();
m_readBuf[0] = '\0';
m_readBuf[READ_BUF_SIZE - 1] = '\0';
}
template<size_t READ_BUF_SIZE, size_t WRITE_BUF_SIZE>