| 24 | { |
| 25 | public: |
| 26 | pinger(boost::asio::io_context& io_context, const char* destination) |
| 27 | : resolver_(io_context), socket_(io_context, icmp::v4()), |
| 28 | timer_(io_context), sequence_number_(0), num_replies_(0) |
| 29 | { |
| 30 | destination_ = *resolver_.resolve(icmp::v4(), destination, "").begin(); |
| 31 | |
| 32 | start_send(); |
| 33 | start_receive(); |
| 34 | } |
| 35 | |
| 36 | private: |
| 37 | void start_send() |