32 void InterfaceThreader::tx_runner_()
34 while (running_.load())
38 interface_->send_packet(timeout_);
58 void InterfaceThreader::rx_runner_()
60 while (running_.load())
62 interface_->receive_packet(timeout_);
81 std::unique_ptr<Interface> interface,
82 std::chrono::microseconds timeout,
84 : interface_(
std::move(interface)),
85 timeout_(
std::move(timeout)),
109 running_.store(
true);
110 tx_thread_ = std::thread(&InterfaceThreader::tx_runner_,
this);
111 rx_thread_ = std::thread(&InterfaceThreader::rx_runner_,
this);
123 running_.store(
false);
Start the interface (and worker threads) immediately.
InterfaceThreader(std::unique_ptr< Interface > interface, std::chrono::microseconds=std::chrono::microseconds(100000), Threads start_threads=InterfaceThreader::START)