
Hi
I have a funciton where we I am using boost::asio to read from the
serial port of my computer.
I have started out with an implementation which uses read, and I am
now trying to convert it to async_read because I want a time out.
When I am trying to use the async_read version, I get timeouts after I
have read one or two charterers, even though I know there are more
charterers to be read on the wire.
Here is the code:
void set_result( boost::optionalboost::system::error_code * a,
boost::system::error_code b ) {
a->reset( b );
}
std::vector (result.data()) + result.size() ); return res;
} else if ( timer_result ) {
throw runtime_error("timeout");
}
}
throw runtime_error("Should not happend");
#else
uint8_t c;
boost::asio::read(cctalk_port, boost::asio::buffer(&c, 1));
std::vector