| 7690 | |
| 7691 | void stop() { should_stop_.store(true, std::memory_order_seq_cst); } |
| 7692 | void close() { |
| 7693 | socket_.cancel(); |
| 7694 | context_.stop(); |
| 7695 | if (context_thread_.joinable()) context_thread_.join(); |
| 7696 | } |
| 7697 | |
| 7698 | void operator()() { |
| 7699 | // For per-operation cancellations we could use the `asio::cancellation_signal`. |