Called by the user of the client class to initiate the connection process. The endpoints will have been obtained using a tcp::resolver.
| 96 | // Called by the user of the client class to initiate the connection process. |
| 97 | // The endpoints will have been obtained using a tcp::resolver. |
| 98 | void start(tcp::resolver::results_type endpoints) |
| 99 | { |
| 100 | // Start the connect actor. |
| 101 | endpoints_ = endpoints; |
| 102 | start_connect(endpoints_.begin()); |
| 103 | |
| 104 | // Start the deadline actor. You will note that we're not setting any |
| 105 | // particular deadline here. Instead, the connect and input actors will |
| 106 | // update the deadline prior to each asynchronous operation. |
| 107 | deadline_.async_wait(std::bind(&client::check_deadline, this)); |
| 108 | } |
| 109 | |
| 110 | // This function terminates all the actors to shut down the connection. It |
| 111 | // may be called by the user of the client class, or by the class itself in |
no test coverage detected