Network: Increase P2P listener thread rest duration (#17474)

1 milisecond is not enough time for WSAPoll to be CPU time efficient, 5 miliseconds seems to address it.
This commit is contained in:
Elad
2025-09-07 13:03:36 +03:00
committed by GitHub
parent 0564842871
commit c76a3366ec
@@ -295,7 +295,8 @@ void p2p_thread::operator()()
}
#ifdef _WIN32
const auto ret_p2p = WSAPoll(p2p_fd.data(), num_p2p_sockets, 1);
// WSAPoll seems to consume a lot of CPU time relative to its waiting duration, upping the timeout solves it
const auto ret_p2p = WSAPoll(p2p_fd.data(), num_p2p_sockets, 5);
#else
const auto ret_p2p = ::poll(p2p_fd.data(), num_p2p_sockets, 1);
#endif