Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio] Clients (try to) connect only once
From: Jens Weller (JensWeller_at_[hidden])
Date: 2009-02-10 12:44:07


> >
> > Inputhandler calls async_connect which returns to one of its members.
> Which
> > works through the first run.
> >
> > How to solve this?
> >
>
> Probably, your io_service object has no more pending work, so its run()
> loop
> exits? Look at the "work" class in asio reference.

Hm, thas very much possible.
I thought I could start the io_service object again, if there is new need for it.
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?

I've just seen the work object too, this solves the problem too. At least at a first glance, I did not have the time for extensive testing yet.

thx.

Jens Weller

-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger01

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