Skip to content

Commit

Permalink
Prevent poll service failure with WSAENOTSOCK on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
paullouisageneau committed Sep 12, 2024
1 parent 57e06d8 commit 5778aa9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/impl/pollservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,13 @@ void PollService::runLoop() {

} while (ret < 0 && (sockerrno == SEINTR || sockerrno == SEAGAIN));

if (ret < 0) {
#ifdef _WIN32
if (ret == WSAENOTSOCK)
continue; // prepare again as the fd has been removed
if (sockerrno == WSAENOTSOCK)
continue; // prepare again as the fd has been removed
#endif
if (ret < 0)
throw std::runtime_error("poll failed, errno=" + std::to_string(sockerrno));
}

process(pfds);
}
Expand Down

0 comments on commit 5778aa9

Please sign in to comment.