Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio] reopening of serial port fails - why?
From: Igor R (boost.lists_at_[hidden])
Date: 2009-03-06 07:53:42


> I tried this:
>
> while (true) // PROBLEM: reentering this loop fails - why?
> {
>  io_service.reset();
>  boost::thread t(boost::bind(&boost::asio::io_service::run, &io_service));
> [...]
>
>
> Now the reconnection does not succeed either and
> after some tries I obtain an invalid file handle error.

It seems that you open your serial_port object in the constructor
"minicom_client" wrapper. But you create it only once, before the loop
starts, don't you? So after you explicitly close serial_port, no one
opens it.


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