poco
poco copied to clipboard
PollSet::poll on Windows always returns immediately after first connection, due to bad event socket implementation
PollSet uses and event fd to interrupt an ongoing poll()
in wakeUp()
. On POSIX platforms this uses eventfd()
and works fine. On Windows, a ServerSocket is created (either as Unix domain socket or TCP socket) instead. The problem is that when that event fd is signaled, the implementation attempts to receive from it. Which is not going to work as it's a ServerSocket. So this eventfd stays signaled forever, causing high CPU load as poll() always returns immediately.