Exemplo n.º 1
0
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)));
 }
Exemplo n.º 3
0
	void stop()
	{
		m_abort = true;
		m_socket.cancel();
		m_socket.close();
	}
Exemplo n.º 4
0
	~dht_server()
	{
		m_socket.cancel();
		m_socket.close();
		if (m_thread) m_thread->join();
	}
Exemplo n.º 5
0
	~udp_tracker()
	{
		m_socket.cancel();
		m_socket.close();
		if (m_thread) m_thread->join();
	}