Boost C++ Libraries: Ticket #12316: ASIO: "Undefined error: 0" on the Mac OS 10.10 and 10.11 https://svn.boost.org/trac10/ticket/12316 <p> Hello. I have some issue with asio. When I try to connect/read/write (blocking and async operations), i get "Undefined error: 0" in the boost::error_code parameter. Interesting thing is that data transfers successfully. Only problem is Undefined error and infinity reads with zero bytes read. iOS (device and simulator) has this error too. If there's nobody listening on the port I try to connect to, "Connection refused" error is returned to the async_connect callback (which is correct behavior). So "Undefined error: 0" appears only if somebody is listening port on the other side. </p> <p> Compiling with xCode and standalone clang with command like clang++ -std=c++11 -Ipath/to/asio/include async_tcp_echo_server.cpp -oserver </p> <p> There's an issue on the asio's github tracker, but there's no activity at all. <a class="ext-link" href="https://github.com/chriskohlhoff/asio/issues/121"><span class="icon">​</span>https://github.com/chriskohlhoff/asio/issues/121</a> </p> <p> Thank you a lot! </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12316 Trac 1.4.3 anonymous Thu, 07 Jul 2016 16:59:35 GMT <link>https://svn.boost.org/trac10/ticket/12316#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12316#comment:1</guid> <description> <p> 0 == success ? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 07 Jul 2016 16:59:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12316#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12316#comment:1</guid> <description> <p> 0 == success ? </p> </description> <category>Ticket</category> </item> <item> <author>David Dovodov <ddovod@…></author> <pubDate>Fri, 08 Jul 2016 06:51:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12316#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12316#comment:2</guid> <description> <p> AFAIK 0 is default value for error code, so it looks like this error code is uninitialized </p> </description> <category>Ticket</category> </item> <item> <author>David Dovodov <ddovod@…></author> <pubDate>Mon, 11 Jul 2016 14:20:49 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12316#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12316#comment:3</guid> <description> <p> Good day for everybody. Is there any info for this issue? </p> </description> <category>Ticket</category> </item> <item> <author>David Dovodov <ddovod@…></author> <pubDate>Tue, 23 Aug 2016 10:45:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12316#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12316#comment:4</guid> <description> <p> Update: examples works fine, sorry, my bad. Assuming there's somebody who is listening 8888 port on the localhost. The code below works bad on iOS/mac os: </p> <blockquote> <p> std::string m_address = "127.0.0.1"; int m_port = 8888; asio::io_service m_service; asio::ip::tcp::socket m_socket(m_service); asio::ip::tcp::endpoint ep(asio::ip::address::from_string(m_address), m_port); m_socket.async_connect(ep, [] (const asio::error_code&amp; err) { </p> <blockquote> <p> std::cout &lt;&lt; "onConnect -&gt; " &lt;&lt; err.message() &lt;&lt; std::endl; </p> </blockquote> <p> }); m_service.run(); </p> </blockquote> <p> Output on a Debian: onConnect -&gt; Success </p> <p> Output on a Mac OS: onConnect -&gt; Undefined error: 0 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sun, 12 Mar 2017 05:33:06 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12316#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12316#comment:5</guid> <description> <p> I am having the same problem exactly. Is there any workaround? </p> </description> <category>Ticket</category> </item> </channel> </rss>