
I'm using boost::asio::serial_port to read and write to a serial port device. I do the reading inside a boost::thread to take advantage of RS-232 being full-duplex. My read calls are like this one: BYTE b; read( m_SerialPort, boost::asio::buffer(&b,1) ); Everything works OK except for shutdown. When I want to end the thread, it's almost always blocked in a read call. How do I unblock it? I tried: - Calling close on the port: This generates an exception, which I can catch, but I was told I can't distinguish shutdown from error if I do this. - Stopping the io_service I passed to the serial_port's constructor. This had no effect, the thread remained blocked on the read call. -- *Darío Eduardo Ramos* Meditech S.A. www.meditech.com.ar (+54) 01147603300, Interno 31 Av. Julio A. Roca 3456 Florida Oeste, Bs.As. Argentina