|
Boost Users : |
Subject: Re: [Boost-users] [asio] Connection not ending
From: Markus Bonk (markus_bonk_at_[hidden])
Date: 2012-05-10 03:31:02
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_at_[hidden]
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_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Igor R
Sent: Wednesday, May 09, 2012 5:35 PM
To: boost-users_at_[hidden]
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_service/_io_service.html
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
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