template<class Protocol, class EndpointSequence, class CompletionToken>
DEDUCED async_connect(basic_socket<Protocol>& s,
const EndpointSequence& endpoints,
CompletionToken&& token);
Returns:
async_connect(s, endpoints, [](auto, auto){ return true; }, forward<CompletionToken>(token))
template<class Protocol, class EndpointSequence,
class ConnectCondition, class CompletionToken>
DEDUCED async_connect(basic_socket<Protocol>& s,
const EndpointSequence& endpoints,
ConnectCondition c,
CompletionToken&& token);
A composed asynchronous operation ([async.reqmts.async.composed]).
Completion signature: void(error_code ec, typename Protocol::endpoint ep).
ec is updated with the result of the s.async_connect(ep, unspecified) operation, if any. If no such element is found, or if the operation fails with one of the error conditions listed below, ep is set to typename Protocol::endpoint(). [ Note: The underlying close, open, and async_connect operations are performed sequentially. — end note ]
template<class Protocol, class InputIterator, class CompletionToken>
DEDUCED async_connect(basic_socket<Protocol>& s,
InputIterator first, InputIterator last,
CompletionToken&& token);
Returns:
async_connect(s, first, last, [](auto, auto){ return true; }, forward<CompletionToken>(token))
template<class Protocol, class InputIterator,
class ConnectCondition, class CompletionToken>
DEDUCED async_connect(basic_socket<Protocol>& s,
InputIterator first, InputIterator last,
ConnectCondition c,
CompletionToken&& token);
A composed asynchronous operation ([async.reqmts.async.composed]).
Completion signature: void(error_code ec, InputIterator i).
Effects: Performs ec.clear(), then finds the first iterator i in the range [first, last) for which:
c(ec, *i) yields true;
s.close(ec) succeeds;
s.open(typename Protocol::endpoint(*i).protocol(), ec) succeeds; and
the asynchronous operation s.async_connect(*i, unspecified) succeeds.
ec is updated with the result of the s.async_connect(*i, unspecified) operation, if any. If no such iterator is found, or if the operation fails with one of the error conditions listed below, i is set to last. [ Note: The underlying close, open, and async_connect operations are performed sequentially. — end note ]