Exit if server startup fails

pull/166/head
SChernykh 2 years ago
parent b191962d32
commit 0e222afd6a

@ -77,7 +77,7 @@ P2PServer::P2PServer(p2pool* pool)
int err = uv_async_init(&m_loop, &m_broadcastAsync, on_broadcast);
if (err) {
LOGERR(1, "uv_async_init failed, error " << uv_err_name(err));
return;
panic();
}
m_broadcastAsync.data = this;
m_broadcastQueue.reserve(2);

@ -70,7 +70,7 @@ StratumServer::StratumServer(p2pool* pool)
const int err = uv_async_init(&m_loop, &m_blobsAsync, on_blobs_ready);
if (err) {
LOGERR(1, "uv_async_init failed, error " << uv_err_name(err));
return;
panic();
}
m_blobsAsync.data = this;
m_blobsQueue.reserve(2);

@ -37,10 +37,18 @@ TCPServer<READ_BUF_SIZE, WRITE_BUF_SIZE>::TCPServer(allocate_client_callback all
panic();
}
uv_async_init(&m_loop, &m_dropConnectionsAsync, on_drop_connections);
err = uv_async_init(&m_loop, &m_dropConnectionsAsync, on_drop_connections);
if (err) {
LOGERR(1, "uv_async_init failed, error " << uv_err_name(err));
panic();
}
m_dropConnectionsAsync.data = this;
uv_async_init(&m_loop, &m_shutdownAsync, on_shutdown);
err = uv_async_init(&m_loop, &m_shutdownAsync, on_shutdown);
if (err) {
LOGERR(1, "uv_async_init failed, error " << uv_err_name(err));
panic();
}
m_shutdownAsync.data = this;
uv_mutex_init_checked(&m_clientsListLock);

Loading…
Cancel
Save