Opened 8 years ago
#10235 new Bugs
a strange problem for deadline_timer
Reported by: | Owned by: | chris_kohlhoff | |
---|---|---|---|
Milestone: | To Be Determined | Component: | asio |
Version: | Boost 1.55.0 | Severity: | Showstopper |
Keywords: | Cc: |
Description
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?