9 May
2012
9 May
'12
3:34 p.m.
I have a sample based on the http server 3 example.
I am calling io_service::stop which ends all the threads and the tcp_server's run routine exits. But currently I am not seeing the destructor of the connection being called. It looks like the shared pointers passed to async_read_some are not being freed. Do I need to do something specific the cancel the connection? I am not destroying the server.
After you call io_service::stop(), io_service::run() exits as soon as possible. The handlers are not invoked and not cleared, so all the shared_ptr's embedded into these handlers are sill alive. The handlers will be cleared on ~io_service invocation, as documented: http://www.boost.org/doc/libs/1_49_0/doc/html/boost_asio/reference/io_servic...