MCPcopy Create free account
hub / github.com/alibaba/async_simple / async_connect

Function async_connect

demo_example/asio/asio/basic_socket.hpp:960–976  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 /**

Callers 2

startFunction · 0.50
send_emailMethod · 0.50

Calls 4

is_openFunction · 0.70
protocolMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected