template<class Protocol, class EndpointSequence>
typename Protocol::endpoint connect(basic_socket<Protocol>& s,
const EndpointSequence& endpoints);
template<class Protocol, class EndpointSequence>
typename Protocol::endpoint connect(basic_socket<Protocol>& s,
const EndpointSequence& endpoints,
error_code& ec);
Returns: connect(s, endpoints, [](auto, auto){ return true; }, ec).
template<class Protocol, class EndpointSequence, class ConnectCondition>
typename Protocol::endpoint connect(basic_socket<Protocol>& s,
const EndpointSequence& endpoints,
ConnectCondition c);
template<class Protocol, class EndpointSequence, class ConnectCondition>
typename Protocol::endpoint connect(basic_socket<Protocol>& s,
const EndpointSequence& endpoints,
ConnectCondition c, error_code& ec);
Returns: typename Protocol::endpoint() if no such element is found, otherwise ep.
Error conditions:
socket_errc::not_found — if endpoints.empty() or if the function object c returned false for all elements in the sequence.
template<class Protocol, class InputIterator>
InputIterator connect(basic_socket<Protocol>& s,
InputIterator first, InputIterator last);
template<class Protocol, class InputIterator>
InputIterator connect(basic_socket<Protocol>& s,
InputIterator first, InputIterator last,
error_code& ec);
Returns: connect(s, first, last, [](auto, auto){ return true; }, ec).
template<class Protocol, class InputIterator, class ConnectCondition>
InputIterator connect(basic_socket<Protocol>& s,
InputIterator first, InputIterator last,
ConnectCondition c);
template<class Protocol, class InputIterator, class ConnectCondition>
InputIterator connect(basic_socket<Protocol>& s,
InputIterator first, InputIterator last,
ConnectCondition c, error_code& ec);
Returns: last if no such iterator is found, otherwise i.