[Boost-bugs] [Boost C++ Libraries] #10235: a strange problem for deadline_timer

Subject: [Boost-bugs] [Boost C++ Libraries] #10235: a strange problem for deadline_timer
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-07-23 16:15:22


#10235: a strange problem for deadline_timer
------------------------------------+----------------------------
 Reporter: cchehewo <china.ygw@…> | Owner: chris_kohlhoff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
  Version: Boost 1.55.0 | Severity: Showstopper
 Keywords: |
------------------------------------+----------------------------
 os:cent os 6.4 32bit.
 boost:1.55.0

 I have these codes for tcp async_connect:
 session->tcp_socket().async_connect(ep, m_strand.wrap(boost::bind(
         &ifstiotcp::_connected, this, session,
 boost::asio::placeholders::error)));

 timer.expires_from_now(boost::posix_time::seconds(5), ec);
 timer.async_wait(m_strand.wrap(boost::bind(&ifstiotcp::_connect_timeout,
 this, session, boost::asio::placeholders::error)));

 and, in _connected function to cancel timer:
 timer.cancel(ec);

 and, in _connected_timeout function:
 if (boost::asio::error::operation_aborted != ec) {
     // timeout in here
 }

 now, a strange problem as follows:
 1) when run to _connected function and cancel deadline_timer success;
 2) after 5 seconds, run the 'timeout in here';
 3) anyone has the same problem?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10235>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC