Skip to content

Commit

Permalink
Enable close-on-interrupt for macOS
Browse files Browse the repository at this point in the history
This behavior is also necessary on macOS.

Fixes #5536 <#5536>
  • Loading branch information
rom1v committed Nov 28, 2024
1 parent ff06b6d commit d01373c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/src/util/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
# define SC_RAW_SOCKET_NONE -1
#endif

#ifdef _WIN32
// On Windows, shutdown() does not interrupt accept() or read() calls, so
// net_interrupt() must call close() instead, and net_close() must behave
// accordingly.
#if defined(_WIN32) || defined(__APPLE__)
// On Windows and macOS, shutdown() does not interrupt accept() or read()
// calls, so net_interrupt() must call close() instead, and net_close() must
// behave accordingly.
// This causes a small race condition (once the socket is closed, its
// handle becomes invalid and may in theory be reassigned before another
// thread calls accept() or read()), but it is deemed acceptable as a
Expand Down

0 comments on commit d01373c

Please sign in to comment.