Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio::serial_port] I can read and write synchronously, but how do I unblock when I want to end?
From: Leo Cacciari (leo.cacciari_at_[hidden])
Date: 2012-02-11 09:04:48


Il 02/09/2012 03:59 PM, Dario Ramos ha scritto:
> 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) );
>

The best solution I'm aware of is to let boost handle the job and use
async_read and async_write.

-- 
Leo Cacciari
Aliae nationes servitutem pati possunt populi romani est propria libertas

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net