1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-09 08:42:40 -05:00

Disable TCP keepalive before closing socket

This commit is contained in:
SChernykh
2023-08-06 14:51:25 +02:00
parent 64f5bb467a
commit 12577df7ba
2 changed files with 9 additions and 0 deletions

View File

@@ -344,6 +344,9 @@ bool xmrig::Client::close()
setState(ClosingState);
if (uv_is_closing(reinterpret_cast<uv_handle_t*>(m_socket)) == 0) {
if (Platform::hasKeepalive()) {
uv_tcp_keepalive(m_socket, 0, 60);
}
uv_close(reinterpret_cast<uv_handle_t*>(m_socket), Client::onClose);
}