Async connect operations using the reactor should not allow speculative completion.
diff --git a/asio/include/asio/detail/reactive_socket_service.hpp b/asio/include/asio/detail/reactive_socket_service.hpp index 6798d5f..ea17b94 100644 --- a/asio/include/asio/detail/reactive_socket_service.hpp +++ b/asio/include/asio/detail/reactive_socket_service.hpp
@@ -1713,7 +1713,7 @@ { op->ec_ = asio::error_code(); reactor_.start_op(reactor::connect_op, - impl.socket_, impl.reactor_data_, op, true); + impl.socket_, impl.reactor_data_, op, false); return; } }