asio::read with timeout
问题 I need to know how to read (sync or async doesn't matters) with a timeout. I want to check if a device is connected with a serial port or not. For that I use asio::write and then I wait for the response of the device. If a device is connected asio::read(serial, boost::asio::buffer(&r,1)) works fine but if there is no device the program stops, which is is why I need the timeout I know that I need a deadline_timer but I have no idea how to use it in the async_read function. An example of how it