title: "Reloading" a Boost Timer bind to a class method
body: <p>I've got some trouble with the asio timer.
  It is bind to a class method, and when I reload the timer (each time I'm waiting for data or ack), the call back method is called (according to the boost spec).
  The problem is that I don't know how to differentiate the cancelation or the completion of the timer.
  How should I do that ?
  Thanks !  </p>
  
  <pre><code>const int TIMER_DURATION = 5000; // ms
  
  tftp_connection::tftp_connection (std::string id,
                                    std::string file_name,
                                    connection_type_enum connection_type,
                                    tftp_server* server,
                                    boost::asio::io_service&amp; io_service)
                  : timer(io_service, boost::posix_time::milliseconds(TIMER_DURATION)) {
        //...
  
        // when sending a block and waiting for acknowledgement
          timer.expires_from_now(boost::posix_time::milliseconds(TIMER_DURATION));
          timer.async_wait(boost::bind(&amp;tftp_connection::timeout_callback , this));
  
  //...
  void tftp_connection::timeout_callback() {
      std::cout &lt;&lt; "Time Out\n"; }
  </code></pre>