"boost_asio.reference.async_connect.overload3.example"></a></span><a class="link" href="overload3.html#boost_asio.reference.async_connect.overload3.example">Example</a>
        </h6>
<pre class="programlisting">std::vector&lt;tcp::endpoint&gt; endpoints = ...;
tcp::socket s(io_context);
boost::asio::async_connect(s,
    endpoints.begin(), endpoints.end(),
    connect_handler);

// ...

void connect_handler(
    const boost::system::error_code&amp; ec,
    std::vector&lt;tcp::endpoint&gt;::iterator i)
{
  //