Hi folks

While reading out a serial interface with boost asio, I used the following timeout protection:

const boost::function<void(const error_code &)> SerialInterface::ON_TIMEOUT(if_then(_1 != error::operation_aborted, throw_exception(bind(constructor<
        SerialInterfaceTimeoutException> ()))));
// ...
void SerialInterface::read(void *buf, size_t size) throw(SerialInterfaceTimeoutException) {
    charTimeout.expires_from_now(maxCharDelay);
    charTimeout.async_wait(ON_TIMEOUT);
// ...

If a timeout occurs, the exception is thrown as expected. However, it is not handed any further from read, but instead the program terminates with a message concerning the exception. Is there any method having a throw() constraint in this async_wait chain?

Thanks for any hint and best regards
Pascal



Reif für die Insel? Das MSN Reisemagazin hilft beim träumen.