Subject: [boost] [ASIO] example clarification (how to)
From: Gaetano Mendola (mendola_at_[hidden])
Date: 2013-12-21 16:09:32
In the asio chat example
the class chat_server implements the async_accept handler with a lambda
without use the shared_from_this pattern, isn't an error destroy the
class while the handler is running? Maybe is not a problem looking at
how is used inside the main but without having knowledge on how is it
going to be used which can be the best way to destroy the chat_server
(or similar code) safely? Is something like the following correct?
//Call dispatching a cancel operation
//in order to be sure to not chain another async_accept
here I'm supposing a single thread is running io_service.run() otherwise
the strand has to be used.
--- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk