MCPcopy Create free account
hub / github.com/boostorg/asio / connect

Function connect

include/boost/asio/basic_socket.hpp:850–861  ·  view source on GitHub ↗

Connect the socket to the specified endpoint. * This function is used to connect a socket to the specified remote endpoint. * The function call will block until the connection is successfully made or * an error occurs. * * The socket is automatically opened if it is not already open. If the * connect fails, and the socket was automatically opened, the socket is * not returned to

Source from the content-addressed store, hash-verified

848 * @endcode
849 */
850 void connect(const endpoint_type& peer_endpoint)
851 {
852 boost::system::error_code ec;
853 if (!is_open())
854 {
855 impl_.get_service().open(impl_.get_implementation(),
856 peer_endpoint.protocol(), ec);
857 boost::asio::detail::throw_error(ec, "connect");
858 }
859 impl_.get_service().connect(impl_.get_implementation(), peer_endpoint, ec);
860 boost::asio::detail::throw_error(ec, "connect");
861 }
862
863 /// Connect the socket to the specified endpoint.
864 /**

Callers 15

connect_to_endpointsMethod · 0.70
mainFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50
clientMethod · 0.50
test_connect_rangeFunction · 0.50
test_connect_range_ecFunction · 0.50
test_connect_range_condFunction · 0.50
test_connect_iterFunction · 0.50

Calls 5

throw_errorFunction · 0.85
is_openFunction · 0.70
openMethod · 0.45
protocolMethod · 0.45
connectMethod · 0.45

Tested by 8

test_connect_rangeFunction · 0.40
test_connect_range_ecFunction · 0.40
test_connect_range_condFunction · 0.40
test_connect_iterFunction · 0.40
test_connect_iter_ecFunction · 0.40
test_connect_iter_condFunction · 0.40