Disable TCP keepalive before closing socket
This commit is contained in:
parent
64f5bb467a
commit
12577df7ba
2 changed files with 9 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue