Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio] Removing server socket from service
From: Igor R (boost.lists_at_[hidden])
Date: 2010-11-03 14:03:36


> Yes I tried that.
> But at my code async operations got triggered with errors from io_service thread and the acceptor objects was destroyed already.

When you use async. approach, the best way to manage your objects
lifetime is to use shared_from_this idiom, just like in asio examples.
This way you ensure that your completion handlers never "hit"
destroyed objects.


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