TCPServer fixes

- Proper shutdown sequence, uv_close() must be called from the event loop thread
- Moved start_listening() to child class constructor because it must be ready before it can listen on sockets
- Added simple memory leak detector for Windows. Linux users can enjoy the leak sanitizer
This commit is contained in:
SChernykh
2021-08-26 23:27:05 +02:00
parent 27e85a922b
commit 3f1ee9ce4b
7 changed files with 303 additions and 33 deletions
+3 -1
View File
@@ -31,7 +31,7 @@ static constexpr uint64_t DEFAULT_BAN_TIME = 600;
namespace p2pool {
StratumServer::StratumServer(p2pool* pool)
: TCPServer(StratumClient::allocate, pool->params().m_stratumAddresses)
: TCPServer(StratumClient::allocate)
, m_pool(pool)
, m_extraNonce(0)
, m_rd{}
@@ -53,6 +53,8 @@ StratumServer::StratumServer(p2pool* pool)
}
m_blobsAsync.data = this;
m_blobsQueue.reserve(2);
start_listening(pool->params().m_stratumAddresses);
}
StratumServer::~StratumServer()