
6 Mar
2009
6 Mar
'09
12:53 p.m.
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.