Boost logo

Boost Users :

Subject: [Boost-users] [Asio] Confusion with socket.cancel()
From: Laurent Fert (fert.laurent.boost_at_[hidden])
Date: 2009-06-22 02:46:31


Hi,

I am getting confused, could anyone clarify the following points?
(Note that I am in a single thread context)

1- After a call to
  socket.async_send_to(buffer, remote_endpoint, write_handler)
followed by a call to
  socket.cancel()
is it possible that the write operation completed before I called cancel()
and that my write_handler will be called with no error?

2- After a call to
  socket.async_send_to(buffer, remote_endpoint, write_handler)
followed by a call to
  socket.cancel()
is it possible that some data has actually been written to the socket (let's
assume the buffer is quite big) and that then, the operation has been
canceled? In such case, would my write_handler be called with both
boost::asio::placeholders::error set AND
boost::asio::placeholders::bytes_transferred equal to the partial data that
has been written?

Thanks,

Laurent



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net