Thank you. I had read that, which is why I mentioned I was not destroying the server. What I want to do is to cap all connections, because say a password has changed. How could I get the io_service to invoke the handlers with a predefined "stop" error? ----------------------------- Markus Bonk Senior Software Engineer 3Dconnexion GmbH Clarita-Bernhard-Str. 18 81249 München Germany Tel: +49 (89) 897 45 42 - 70 Fax: +49 (89) 897 45 42 - 50 mailto:markus_bonk@3dconnexion.com Kennen Sie schon die NEUE SpaceMouse Pro? Hier klicken um mehr zu erfahren! http://www.3dconnexion.de/products/spacemousepro.html?3dxcp=signature_mail Geschaeftsfuehrer: Antonio Pascucci Sitz der Gesellschaft: Muenchen Registergericht: Muenchen HRB 99232 -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Igor R Sent: Wednesday, May 09, 2012 5:35 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] [asio] Connection not ending
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... _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users