|  | Home | Libraries | People | FAQ | More | 
Establishes a connection by trying each endpoint in a sequence.
template< class Iterator, class ConnectCondition> Iterator connect( Iterator begin, Iterator end, ConnectCondition connect_condition, error_code& ec);
            This function attempts to connect the stream to one of a sequence of
            endpoints by trying each endpoint until a connection is successfully
            established. The underlying socket is automatically opened if needed.
            An automatically opened socket is not returned to the closed state upon
            failure. The algorithm, known as a composed operation,
            is implemented in terms of calls to the underlying socket's connect function.
          
| Name | Description | 
|---|---|
| 
                       | An iterator pointing to the start of a sequence of endpoints. | 
| 
                       | An iterator pointing to the end of a sequence of endpoints. | 
| 
                       | A function object that is called prior to each connection attempt. The signature of the function object must be: bool connect_condition( error_code const& ec, typename Protocol::endpoint const& next); 
                      The  | 
| 
                       | 
                      Set to indicate what error occurred, if any. If the sequence
                      is empty, set to  | 
On success, an iterator denoting the successfully connected endpoint. Otherwise, the end iterator.