i'm not sure if it's a bug or a feature, but when setting a socket to non_blocking calling connect may still block. this is especially an issue on windows where connect to localhost on a socket without listener will block for a second instead of failing directly
i'm not sure if it's a bug or a feature, but when setting a socket to
non_blocking
callingconnect
may still block. this is especially an issue on windows whereconnect
to localhost on a socket without listener will block for a second instead of failing directlyit seems that
sync_connect
( https://github.com/chriskohlhoff/asio/blob/1f8d154829b902dbc45a651587c6c6df948358e8/asio/include/asio/detail/impl/socket_ops.ipp#L509) does not handle theuser_set_non_blocking
state, where all other socket operations take this flag into account. (e.g. https://github.com/chriskohlhoff/asio/blob/1f8d154829b902dbc45a651587c6c6df948358e8/asio/include/asio/detail/impl/socket_ops.ipp#L1119-L1123)