| 958 | template < |
| 959 | ASIO_COMPLETION_TOKEN_FOR(void (asio::error_code)) |
| 960 | ConnectHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)> |
| 961 | ASIO_INITFN_AUTO_RESULT_TYPE(ConnectHandler, |
| 962 | void (asio::error_code)) |
| 963 | async_connect(const endpoint_type& peer_endpoint, |
| 964 | ASIO_MOVE_ARG(ConnectHandler) handler |
| 965 | ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) |
| 966 | { |
| 967 | asio::error_code open_ec; |
| 968 | if (!is_open()) |
| 969 | { |
| 970 | const protocol_type protocol = peer_endpoint.protocol(); |
| 971 | impl_.get_service().open(impl_.get_implementation(), protocol, open_ec); |
| 972 | } |
| 973 | |
| 974 | return async_initiate<ConnectHandler, void (asio::error_code)>( |
| 975 | initiate_async_connect(this), handler, peer_endpoint, open_ec); |
| 976 | } |
| 977 | |
| 978 | /// Set an option on the socket. |
| 979 | /** |
no test coverage detected