Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio] Clients (try to) connect only once
From: Igor R (boost.lists_at_[hidden])
Date: 2009-02-10 13:36:37


>
> Hm, thas very much possible.
> I thought I could start the io_service object again, if there is new need
> for it.

You can restart io_service::run after it returns, but you should call
io_service::reset() first.

> Maybe I should make a Session class, which holds its own io object and
> inputhandler, so I only create a session in my client, and the rest is then
> tied to the Session instance. Would that work?

The decision who should own io_service(s) depends on your application
design. You've got examples of asio-based design here:
http://www.boost.org/doc/libs/1_38_0/doc/html/boost_asio/examples.html



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