From 03334bb123829150ad97069e123ca5a8d2b8e1c7 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Tue, 5 Apr 2022 17:20:01 +1000 Subject: [PATCH] For UNIX domain sockets on linux, connect() may yield EAGAIN to indicate an in-progress operation. --- include/boost/asio/detail/impl/socket_ops.ipp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/boost/asio/detail/impl/socket_ops.ipp b/include/boost/asio/detail/impl/socket_ops.ipp index ba4c8c4372..44c40a6931 100644 --- a/include/boost/asio/detail/impl/socket_ops.ipp +++ b/include/boost/asio/detail/impl/socket_ops.ipp @@ -482,7 +482,12 @@ int connect(socket_type s, const socket_addr_type* addr, get_last_error(ec, result != 0); #if defined(__linux__) if (result != 0 && ec == boost::asio::error::try_again) - ec = boost::asio::error::no_buffer_space; + { + if (addr->sa_family == AF_UNIX) + ec = boost::asio::error::in_progress; + else + ec = boost::asio::error::no_buffer_space; + } #endif // defined(__linux__) return result; }