void check_deadline(deadline_timer& deadline, udp::socket& socket) { if (deadline.expires_at() <= deadline_timer::traits_type::now()) { socket.cancel(); deadline.expires_at(boost::posix_time::pos_infin); } deadline.async_wait(boost::bind(&check_deadline, boost::ref(deadline), boost::ref(socket))); }
void deadlineCallback(boost::asio::deadline_timer& t, udp::socket& s) { if (t.expires_at() <= boost::asio::deadline_timer::traits_type::now()) { s.cancel(); t.expires_at(boost::posix_time::pos_infin); } t.async_wait(boost::bind(&CompactRIOCommunicationNode::deadlineCallback, this, boost::ref(t), boost::ref(s))); }
void stop() { m_abort = true; m_socket.cancel(); m_socket.close(); }
~dht_server() { m_socket.cancel(); m_socket.close(); if (m_thread) m_thread->join(); }
~udp_tracker() { m_socket.cancel(); m_socket.close(); if (m_thread) m_thread->join(); }