alexott/boost-asio-examples — pull request #3 by AlexeyAB (2013-06-19 10:51:19+00:00)
Title: Some fixes for multi-acceptors and using shared_ptr<>:

- run multiple async acceptors in different threads
- use boost::shared_ptr as local variable (no member of the class) for each acceptor
- use boost::move to move boost::shared_ptr<> without copy and memory barrier of atomic counter
- use boost::make_shared<> to create each connection
- remove: boost::enable_shared_from_this and shared_from_this().reset(); which can only destroy a copy of the returned pointer shared_ptr<>, and can't destroying current object. The object is automatically destroyed after the completion of the function: void connection::run() - you can see it if using std::cout in destructor: ~connection()
- use a qualifier "const" for a "std::string connection::message_" that is not thread-safe on write

For completeness :)
Best regards, Alexey