|
Boost Users : |
Subject: Re: [Boost-users] [ASIO] serial_port read seems to lost packets
From: Igor R (boost.lists_at_[hidden])
Date: 2009-04-09 16:18:02
> void SerialPort::read_complete(const boost::system::error_code& error,
> size_t bytes_transferred)
> {
> Â // the asynchronous read operation has now completed
> Â if (!error)
> Â {
> Â Â // saving data to vector
> Â Â _read_buffer.append(_buf, bytes_transferred);
> Â cout << _read_buffer << endl;
> Â }
> Â // start waiting for another asynchronous read again
> Â read_start();
> };
What if you move "if (!error)" condition down and put it before read_start()?
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