Boost logo

Boost Users :

From: Joost Kraaijeveld (J.Kraaijeveld_at_[hidden])
Date: 2021-04-19 17:27:51


Hi,

In short my program:
- creates an io_service
- calls acceptor::async_accept
- calls io_service.run
- handle several connections OK
- calls io_service.stop
- the acceptor goes out of scope (i.e. the destructor of the owning
object is ran)
- calls io_service.restart
- calls acceptor::async_accept which then throws "Operation cancelled"

Should it be possible to do this? When/under what circumstances does
async_accept throw this exception?

Could it be connected with the fact that the acceptor's destructors
documents that is does some cleanup but actually does nothing, from the
source:

/// Destroys the acceptor.
  /**
   * This function destroys the acceptor, cancelling any outstanding
   * asynchronous operations associated with the acceptor as if by calling
   * @c cancel.
   */
  ~basic_socket_acceptor()
  {
  }

OS: Linux Debian Bullseye, Boost 1.74, gcc 10

TIA

Joost


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