Boost C++ Libraries: Ticket #13335: When using unix domain socket (boost::asio::local::stream_protocol), synchronous write may not respond sometimes on macOS https://svn.boost.org/trac10/ticket/13335 <p> In very intermittent situations, synchronous write does not wake up in the following situations: </p> <ol><li>The server application uses a unix domain socket and accepts and reads asynchronously. </li><li>The client application uses a unix domain socket, and there is a thread that performs synchronous write repeatedly. Disconnect and reconnect at any time. </li></ol><p> There is no issue when checking on Windows / Mac with tcp socket. UDS (boost::asio::local::stream_protocol) has issue when checking on Mac. </p> <p> When testing with boost library 1.62.0 and 1.65.0 in macOS 10.12 environment, I confirmed that an issue occurred. </p> <p> The source code of the function with no response is as follows. </p> <pre class="wiki">int poll_write (socket_type s, state_type state, boost :: system :: error_code &amp; ec) {   if (s == invalid_socket)   {     ec = boost :: asio :: error :: bad_descriptor;     return socket_error_retval;   } #if defined (BOOST_ASIO_WINDOWS) \   || defined (__ CYGWIN__) \   || defined (__ SYMBIAN32__) ... #else // defined (BOOST_ASIO_WINDOWS)       // || defined (__ CYGWIN__)       // || defined (__ SYMBIAN32__)   pollfd fds;   fds.fd = s;   FDS.Events = POLLOUT;   FDS.revents = 0;   int timeout = (state &amp; user_set_non_blocking)? 0: -1;   clear_last_error ();   int result = error_wrapper (:: poll (&amp; fds, 1, timeout), ec); //!!! ::poll is not wakeup even if socket cancelled and closed #endif // defined (BOOST_ASIO_WINDOWS)        // || defined (__ CYGWIN__)        // || defined (__ SYMBIAN32__) ... } </pre><p> Attached test project. (xcode 8.3 project) </p> <p> The following settings should be changed as appropriate. </p> <ul><li>Modify the "Link Binary With Libraries" of "Build Phases" as appropriate for both server / client projects. </li><li>Modify the "Header Search Paths" and "Library Search Path" of the Build Settings as appropriate for both server / client projects. </li></ul><p> I do not speak English well so I used Google translation. Therefore, the contents may be awkward. I hope you understand. And, I hope this issue is resolved. </p> <p> <em>Note. I used the compiled library. Compilation builds version 1.65.0 using the ofxOSXBoost (on <a class="missing wiki">GitHub</a>) script (build-libc ++ withBitcode).</em> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13335 Trac 1.4.3 seungrye@… Mon, 11 Dec 2017 06:50:18 GMT attachment set https://svn.boost.org/trac10/ticket/13335 https://svn.boost.org/trac10/ticket/13335 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_asio_uds_poll_not_response.zip</span> </li> </ul> <p> xcode project that reproduct issue. </p> Ticket