Boost logo

Boost Users :

From: Richard Hodges (hodges.r_at_[hidden])
Date: 2021-04-19 18:53:35


On Mon, 19 Apr 2021 at 20:39, Joost Kraaijeveld via Boost-users <
boost-users_at_[hidden]> wrote:

> 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?
>

Difficult to comment without compiling up the code and trying it locally.
Are you able to share a git repo that I can build? (cmake if possible)

Thanks.

>
> 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 mailing list
> Boost-users_at_[hidden]
> https://lists.boost.org/mailman/listinfo.cgi/boost-users
>



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