chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.72k stars 1.19k forks source link

async_connect for Unix domain sockets broken (EAGAIN) #1365

Open slay-er opened 9 months ago

slay-er commented 9 months ago

A small change (https://github.com/boostorg/asio/commit/03334bb123829150ad97069e123ca5a8d2b8e1c7) some time ago leads to a different behavior in the case when connect() returns EAGAIN. Before the change the "connect handler" was called with the error no_buffer_space and in my code I could then repeat the connect().

With the current version of Asio, it seems that the "connect handler" is no longer called in case of an error (always succeeds), but instead the follow-up call to "async_write" fails with the error not_connected. As it seems setting the ec to "in_progress" leads to a different flow in Asio.