| 121 | |
| 122 | private: |
| 123 | void start_connect(tcp::resolver::results_type::iterator endpoint_iter) |
| 124 | { |
| 125 | if (endpoint_iter != endpoints_.end()) |
| 126 | { |
| 127 | std::cout << "Trying " << endpoint_iter->endpoint() << "...\n"; |
| 128 | |
| 129 | // Set a deadline for the connect operation. |
| 130 | deadline_.expires_after(std::chrono::seconds(60)); |
| 131 | |
| 132 | // Start the asynchronous connect operation. |
| 133 | socket_.async_connect(endpoint_iter->endpoint(), |
| 134 | std::bind(&client::handle_connect, |
| 135 | this, _1, endpoint_iter)); |
| 136 | } |
| 137 | else |
| 138 | { |
| 139 | // There are no more endpoints to try. Shut down the client. |
| 140 | stop(); |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | void handle_connect(const boost::system::error_code& error, |
| 145 | tcp::resolver::results_type::iterator endpoint_iter) |
nothing calls this directly
no test coverage detected